mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
[2236] Access Mutex::locked() only when ENABLE_DEBUG is defined
This commit is contained in:
@@ -274,10 +274,12 @@ public:
|
|||||||
shared_ptr<ConfigurableClientList> getDataSrcClientList(
|
shared_ptr<ConfigurableClientList> getDataSrcClientList(
|
||||||
const RRClass& rrclass)
|
const RRClass& rrclass)
|
||||||
{
|
{
|
||||||
// TODO: Debug-build only check
|
#ifdef ENABLE_DEBUG
|
||||||
|
// Debug-build only check
|
||||||
if (!mutex_.locked()) {
|
if (!mutex_.locked()) {
|
||||||
isc_throw(isc::Unexpected, "Not locked!");
|
isc_throw(isc::Unexpected, "Not locked!");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
const std::map<RRClass, shared_ptr<ConfigurableClientList> >::
|
const std::map<RRClass, shared_ptr<ConfigurableClientList> >::
|
||||||
const_iterator it(datasrc_client_lists_->find(rrclass));
|
const_iterator it(datasrc_client_lists_->find(rrclass));
|
||||||
if (it == datasrc_client_lists_->end()) {
|
if (it == datasrc_client_lists_->end()) {
|
||||||
@@ -935,10 +937,12 @@ AuthSrv::destroyDDNSForwarder() {
|
|||||||
|
|
||||||
AuthSrv::DataSrcClientListsPtr
|
AuthSrv::DataSrcClientListsPtr
|
||||||
AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
|
AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
|
||||||
// TODO: Debug-build only check
|
#ifdef ENABLE_DEBUG
|
||||||
|
// Debug-build only check
|
||||||
if (!impl_->mutex_.locked()) {
|
if (!impl_->mutex_.locked()) {
|
||||||
isc_throw(isc::Unexpected, "Not locked!");
|
isc_throw(isc::Unexpected, "Not locked!");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
std::swap(new_lists, impl_->datasrc_client_lists_);
|
std::swap(new_lists, impl_->datasrc_client_lists_);
|
||||||
return (new_lists);
|
return (new_lists);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user