Browse Source

[2198] Make direct methods on Mutex private

Mukund Sivaraman 12 years ago
parent
commit
13e9951ecd
2 changed files with 1 additions and 18 deletions
  1. 1 0
      src/lib/util/threads/sync.h
  2. 0 18
      src/lib/util/threads/tests/lock_unittest.cc

+ 1 - 0
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.

+ 0 - 18
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