code reviews

This commit is contained in:
Jinhao
2015-10-13 01:38:53 +08:00
parent 500aa030ae
commit 1b5aed2e5f
41 changed files with 830 additions and 1001 deletions

View File

@@ -5,7 +5,7 @@ namespace nana
namespace detail
{
//class events_operation
typedef std::lock_guard<std::recursive_mutex> lock_guard;
using lock_guard = std::lock_guard<std::recursive_mutex>;
void events_operation::make(window wd, const std::shared_ptr<general_events>& sp)
{
@@ -22,21 +22,21 @@ namespace nana
void events_operation::register_evt(event_handle evt)
{
lock_guard lock(mutex_);
register_.insert(evt);
handles_.insert(evt);
}
void events_operation::cancel(event_handle evt)
{
lock_guard lock(mutex_);
register_.erase(evt);
handles_.erase(evt);
}
void events_operation::erase(event_handle evt)
{
lock_guard lock(mutex_);
auto i = register_.find(evt);
if (i != register_.end())
auto i = handles_.find(evt);
if (i != handles_.end())
{
reinterpret_cast<detail::docker_interface*>(evt)->get_event()->remove(evt);
}