From: Mukund Sivaraman Date: Tue, 23 Oct 2012 03:54:50 +0000 (+0530) Subject: [2236] Access Mutex::locked() only when ENABLE_DEBUG is defined X-Git-Tag: trac2487_base~18^2~33^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f4b3724e1e06933646dcbee14f31eb2713a514d;p=thirdparty%2Fkea.git [2236] Access Mutex::locked() only when ENABLE_DEBUG is defined --- diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 315a7527de..bf653a486e 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -274,10 +274,12 @@ public: shared_ptr getDataSrcClientList( const RRClass& rrclass) { - // TODO: Debug-build only check +#ifdef ENABLE_DEBUG + // Debug-build only check if (!mutex_.locked()) { isc_throw(isc::Unexpected, "Not locked!"); } +#endif const std::map >:: const_iterator it(datasrc_client_lists_->find(rrclass)); if (it == datasrc_client_lists_->end()) { @@ -935,10 +937,12 @@ AuthSrv::destroyDDNSForwarder() { AuthSrv::DataSrcClientListsPtr AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) { - // TODO: Debug-build only check +#ifdef ENABLE_DEBUG + // Debug-build only check if (!impl_->mutex_.locked()) { isc_throw(isc::Unexpected, "Not locked!"); } +#endif std::swap(new_lists, impl_->datasrc_client_lists_); return (new_lists); }