2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-29 21:18:02 +00:00

[2198] Make direct methods on Mutex private

This commit is contained in:
Mukund Sivaraman 2012-10-22 04:57:51 +05:30
parent f8fb9a002d
commit 13e9951ecd
2 changed files with 1 additions and 18 deletions

View File

@ -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.

View File

@ -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