]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2198] Make direct methods on Mutex private
authorMukund Sivaraman <muks@isc.org>
Sun, 14 Oct 2012 16:49:47 +0000 (22:19 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 14 Oct 2012 16:49:47 +0000 (22:19 +0530)
src/lib/util/threads/lock.h
src/lib/util/threads/tests/lock_unittest.cc

index 7327d80eccc74b0fe55cc3ae3c618023600123f4..4992bdb7664bdda7a1155b3d6e5d18ebbf6b09ad 100644 (file)
@@ -134,6 +134,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.
index 7e15a2025ccd56a16107bfcbb0e9ba6cdc69d659..0b4d3ce4ecffcac34a791e0e5e1e18daef2487bd 100644 (file)
@@ -25,24 +25,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