MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / lockRead

Method lockRead

Libraries/Threading/Threading.cpp:57–66  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------------- RWLock -------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

55// RWLock
56//-------------------------------------------------------------------------------------------------------
57void SC::RWLock::lockRead()
58{
59 mutex.lock();
60 while (writerActive || waitingWriters > 0)
61 {
62 readersQ.wait(mutex);
63 }
64 activeReaders++;
65 mutex.unlock();
66}
67
68void SC::RWLock::unlockRead()
69{

Callers 1

testRWLockMethod · 0.80

Calls 3

lockMethod · 0.45
waitMethod · 0.45
unlockMethod · 0.45

Tested by 1

testRWLockMethod · 0.64