From 13e9951ecd5877f8942fee9af7065d8c6c20d1ac Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Mon, 22 Oct 2012 04:57:51 +0530 Subject: [PATCH] [2198] Make direct methods on Mutex private --- src/lib/util/threads/sync.h | 1 + src/lib/util/threads/tests/lock_unittest.cc | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) 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