diff --git a/src/lib/util/threads/sync.h b/src/lib/util/threads/sync.h index cdbd5c1b4f..a539f45fad 100644 --- a/src/lib/util/threads/sync.h +++ b/src/lib/util/threads/sync.h @@ -127,6 +127,7 @@ public: /// \todo Disable in non-debug build bool locked() const; +private: /// \brief Lock the mutex /// /// This method blocks until the mutex can be locked. diff --git a/src/lib/util/threads/tests/lock_unittest.cc b/src/lib/util/threads/tests/lock_unittest.cc index 9deddd7fcf..9c17e6fc65 100644 --- a/src/lib/util/threads/tests/lock_unittest.cc +++ b/src/lib/util/threads/tests/lock_unittest.cc @@ -26,24 +26,6 @@ using namespace isc::util::thread; namespace { -TEST(MutexTest, direct) { - Mutex mutex; - EXPECT_FALSE(mutex.locked()); // Debug-only build - - mutex.lock(); - EXPECT_TRUE(mutex.locked()); // Debug-only build - - EXPECT_FALSE(mutex.tryLock()); - - mutex.unlock(); - EXPECT_FALSE(mutex.locked()); // Debug-only build - - EXPECT_TRUE(mutex.tryLock()); - - mutex.unlock(); - EXPECT_FALSE(mutex.locked()); // Debug-only build -} - // If we try to lock the debug mutex multiple times, it should throw. TEST(MutexTest, lockMultiple) { // TODO: Once we support non-debug mutexes, disable the test if we compile