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

Method lockWrite

Libraries/Threading/Threading.cpp:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void SC::RWLock::lockWrite()
80{
81 mutex.lock();
82 waitingWriters++;
83 while (writerActive || activeReaders > 0)
84 {
85 writersQ.wait(mutex);
86 }
87 waitingWriters--;
88 writerActive = true;
89 mutex.unlock();
90}
91
92void SC::RWLock::unlockWrite()
93{

Callers 1

testRWLockMethod · 0.80

Calls 3

lockMethod · 0.45
waitMethod · 0.45
unlockMethod · 0.45

Tested by 1

testRWLockMethod · 0.64