| 198 | } |
| 199 | |
| 200 | void 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 | |
| 226 | bool GlobalRWLock::lockRead(thread_db* tdbb, SSHORT wait, const bool queueJump) |
| 227 | { |
no test coverage detected