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

Method unlockWrite

src/jrd/GlobalRWLock.cpp:200–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void GlobalRWLock::unlockWrite(thread_db* tdbb, const bool release)
201{
202 SET_TDBB(tdbb);
203
204 CheckoutLockGuard counterGuard(tdbb, counterMutex, FB_FUNCTION, true);
205
206 COS_TRACE(("(%p)->unlockWrite readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)",
207 this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical));
208
209 currentWriter = false;
210
211 if (!lockCaching || release)
212 LCK_release(tdbb, cachedLock);
213 else if (blocking)
214 LCK_downgrade(tdbb, cachedLock);
215
216 blocking = false;
217
218 if (cachedLock->lck_physical < LCK_read)
219 invalidate(tdbb);
220
221 writerFinished.notifyAll();
222 COS_TRACE(("(%p)->unlockWrite end readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)",
223 this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical));
224}
225
226bool GlobalRWLock::lockRead(thread_db* tdbb, SSHORT wait, const bool queueJump)
227{

Callers 3

unlockStateWriteMethod · 0.80
unlockAllocWriteMethod · 0.80
endBackupMethod · 0.80

Calls 4

SET_TDBBFunction · 0.85
LCK_releaseFunction · 0.85
LCK_downgradeFunction · 0.85
notifyAllMethod · 0.80

Tested by

no test coverage detected