Browse Source

[2332] changed one exception to assert() based on review discussion

JINMEI Tatuya 12 years ago
parent
commit
c450d77e81
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/lib/util/threads/lock.cc

+ 4 - 3
src/lib/util/threads/lock.cc

@@ -111,9 +111,10 @@ Mutex::~Mutex() {
 
 void
 Mutex::postLockAction() {
-    if (impl_->locked_count != 0) {
-        isc_throw(isc::InvalidOperation, "Lock attempt for locked mutex");
-    }
+    // This assertion would fail only in non-debugging mode, in which case
+    // this method wouldn't be called either, so we simply assert the
+    // condition.
+    assert(impl_->locked_count == 0);
     ++impl_->locked_count;
 }