From 4f4b3724e1e06933646dcbee14f31eb2713a514d Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Tue, 23 Oct 2012 09:24:50 +0530 Subject: [PATCH] [2236] Access Mutex::locked() only when ENABLE_DEBUG is defined --- src/bin/auth/auth_srv.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); }