From: Mukund Sivaraman Date: Sun, 14 Oct 2012 16:49:47 +0000 (+0530) Subject: [2198] Make direct methods on Mutex private X-Git-Tag: trac2402_base~28^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecef170dd0af4f282d4426ef663b667c76873737;p=thirdparty%2Fkea.git [2198] Make direct methods on Mutex private --- diff --git a/src/lib/util/threads/lock.h b/src/lib/util/threads/lock.h index 7327d80ecc..4992bdb766 100644 --- a/src/lib/util/threads/lock.h +++ b/src/lib/util/threads/lock.h @@ -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. diff --git a/src/lib/util/threads/tests/lock_unittest.cc b/src/lib/util/threads/tests/lock_unittest.cc index 7e15a2025c..0b4d3ce4ec 100644 --- a/src/lib/util/threads/tests/lock_unittest.cc +++ b/src/lib/util/threads/tests/lock_unittest.cc @@ -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