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

Method unlockRead

src/jrd/GlobalRWLock.cpp:302–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void GlobalRWLock::unlockRead(thread_db* tdbb)
303{
304 SET_TDBB(tdbb);
305
306 CheckoutLockGuard counterGuard(tdbb, counterMutex, FB_FUNCTION, true);
307
308 COS_TRACE(("(%p)->unlockRead readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)",
309 this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical));
310 readers--;
311
312 if (!readers)
313 {
314 if (!lockCaching || pendingWriters || blocking)
315 {
316 LCK_release(tdbb, cachedLock); // Release since concurrent request needs LCK_write
317 invalidate(tdbb);
318 }
319
320 noReaders.notifyAll();
321 }
322 COS_TRACE(("(%p)->unlockRead end readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)",
323 this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical));
324}
325
326bool GlobalRWLock::tryReleaseLock(thread_db* tdbb)
327{

Callers 2

lockStateReadMethod · 0.80
unlockAllocReadMethod · 0.80

Calls 3

SET_TDBBFunction · 0.85
LCK_releaseFunction · 0.85
notifyAllMethod · 0.80

Tested by

no test coverage detected