MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / beginRead

Method beginRead

src/common/classes/rwlock.h:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 return false;
138 }
139 void beginRead(const char* aReason)
140 {
141 if (!tryBeginRead(aReason))
142 {
143 { // scope block
144 MutexLockGuard guard(blockedReadersLock, "RWLock::beginRead");
145 ++blockedReaders;
146 }
147 while (!tryBeginRead(aReason))
148 {
149 if (WaitForSingleObject(readers_semaphore, INFINITE) != WAIT_OBJECT_0)
150 system_call_failed::raise("WaitForSingleObject");
151 }
152 { // scope block
153 MutexLockGuard guard(blockedReadersLock, "RWLock::beginRead");
154 --blockedReaders;
155 }
156 }
157 }
158 void beginWrite(const char* aReason)
159 {
160 if (!tryBeginWrite(aReason))

Callers 4

LocalAllocGuardMethod · 0.80
lockStateReadMethod · 0.80
FileExtendLockGuardMethod · 0.80
ReadLockGuardMethod · 0.80

Calls 1

raiseFunction · 0.85

Tested by

no test coverage detected