MCPcopy Create free account
hub / github.com/Kitware/CMake / lockWriter

Method lockWriter

Utilities/cmcppdap/src/rwmutex.h:72–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void RWMutex::lockWriter() {
73 std::unique_lock<std::mutex> lock(mutex);
74 if (readLocks > 0) {
75 pendingWriteLocks++;
76 cv.wait(lock, [&] { return readLocks == 0; });
77 pendingWriteLocks--;
78 }
79 lock.release(); // Keep lock held
80}
81
82void RWMutex::unlockWriter() {
83 if (pendingWriteLocks > 0) {

Callers 1

WLockMethod · 0.80

Calls 2

waitMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected