From: JINMEI Tatuya Date: Mon, 22 Oct 2012 17:55:53 +0000 (-0700) Subject: [2211] use swap instead of splice. for this purpose it's enough and simpler. X-Git-Tag: trac2402_base~3^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07b436b864bd3193ecafbfe1f9c1fa54f90ac342;p=thirdparty%2Fkea.git [2211] use swap instead of splice. for this purpose it's enough and simpler. --- diff --git a/src/bin/auth/datasrc_clients_mgr.h b/src/bin/auth/datasrc_clients_mgr.h index 01c346f43b..4cef69ef23 100644 --- a/src/bin/auth/datasrc_clients_mgr.h +++ b/src/bin/auth/datasrc_clients_mgr.h @@ -356,13 +356,12 @@ DataSrcClientsBuilderBase::run() { std::list current_commands; { // Move all new commands to local queue under the protection of - // queue_mutex_. Note that list::splice() should never throw. + // queue_mutex_. typename MutexType::Locker locker(*queue_mutex_); while (command_queue_->empty()) { cond_->wait(*queue_mutex_); } - current_commands.splice(current_commands.end(), - *command_queue_); + current_commands.swap(*command_queue_); } // the lock is release here. while (keep_running && !current_commands.empty()) {