mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 05:27:55 +00:00
[2198] Make direct methods on Mutex private
This commit is contained in:
parent
f8fb9a002d
commit
13e9951ecd
@ -127,6 +127,7 @@ public:
|
|||||||
/// \todo Disable in non-debug build
|
/// \todo Disable in non-debug build
|
||||||
bool locked() const;
|
bool locked() const;
|
||||||
|
|
||||||
|
private:
|
||||||
/// \brief Lock the mutex
|
/// \brief Lock the mutex
|
||||||
///
|
///
|
||||||
/// This method blocks until the mutex can be locked.
|
/// This method blocks until the mutex can be locked.
|
||||||
|
@ -26,24 +26,6 @@ using namespace isc::util::thread;
|
|||||||
|
|
||||||
namespace {
|
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.
|
// If we try to lock the debug mutex multiple times, it should throw.
|
||||||
TEST(MutexTest, lockMultiple) {
|
TEST(MutexTest, lockMultiple) {
|
||||||
// TODO: Once we support non-debug mutexes, disable the test if we compile
|
// TODO: Once we support non-debug mutexes, disable the test if we compile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user