From: JINMEI Tatuya Date: Tue, 23 Oct 2012 17:18:33 +0000 (-0700) Subject: [2211] removed an extra block from sendCommand() with clarification comments X-Git-Tag: trac2402_base~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d709ef90b8f23a6c41a05d2f5a62cb91840fde0d;p=thirdparty%2Fkea.git [2211] removed an extra block from sendCommand() with clarification comments --- diff --git a/src/bin/auth/datasrc_clients_mgr.h b/src/bin/auth/datasrc_clients_mgr.h index 4d66006022..4e133304d1 100644 --- a/src/bin/auth/datasrc_clients_mgr.h +++ b/src/bin/auth/datasrc_clients_mgr.h @@ -242,11 +242,12 @@ private: void sendCommand(datasrc_clientmgr_internal::CommandID command, data::ConstElementPtr arg) { - { - typename MutexType::Locker locker(queue_mutex_); - command_queue_.push_back( - datasrc_clientmgr_internal::Command(command, arg)); - } + // The lock will be held until the end of this method. Only + // push_back has to be protected, but we can avoid having an extra + // block this way. + typename MutexType::Locker locker(queue_mutex_); + command_queue_.push_back( + datasrc_clientmgr_internal::Command(command, arg)); cond_.signal(); }