code reviews
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user