MCPcopy Create free account
hub / github.com/NativeScript/android / AquireReadLock

Method AquireReadLock

test-app/runtime/src/main/cpp/ReadWriteLock.cpp:14–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void ReadWriteLock::AquireReadLock() {
15 //wait till there are no waiting writers and increment active readers
16 std::unique_lock<std::mutex> lk(shared);
17 while ( waiting_writers != 0 ) { //starving readers and giving writer priority
18 reader_gate.wait(lk);
19 }
20 active_readers++;
21 lk.unlock();
22}
23
24void ReadWriteLock::ReleaseReadUnlock() {
25 //get lock decrement active readers and notify one waiting writer

Callers

nothing calls this directly

Calls 1

unlockMethod · 0.80

Tested by

no test coverage detected