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

Function internal_dequeue

src/jrd/lck.cpp:1266–1306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1264
1265
1266static void internal_dequeue(thread_db* tdbb, Lock* lock)
1267{
1268/**************************************
1269 *
1270 * i n t e r n a l _ d e q u e u e
1271 *
1272 **************************************
1273 *
1274 * Functional description
1275 * Dequeue a lock. If there are identical
1276 * compatible locks, check to see whether
1277 * the lock needs to be downgraded.
1278 *
1279 **************************************/
1280 SET_TDBB(tdbb);
1281 Database* const dbb = tdbb->getDatabase();
1282
1283 fb_assert(LCK_CHECK_LOCK(lock));
1284 fb_assert(lock->lck_compatible);
1285
1286 // if this is the last identical lock in the hash table, release it
1287
1288 Lock* match;
1289 if (hash_remove_lock(lock, &match))
1290 {
1291 if (!dbb->lockManager()->dequeue(lock->lck_id))
1292 {
1293 bug_lck("LOCK_deq() failed in Lock:internal_dequeue");
1294 }
1295
1296 lock->lck_id = 0;
1297 lock->lck_physical = lock->lck_logical = LCK_none;
1298 return;
1299 }
1300
1301 // check for a potential downgrade
1302
1303 FbLocalStatus statusVector;
1304 internal_downgrade(tdbb, &statusVector, match);
1305 fb_assert(statusVector.isEmpty());
1306}
1307
1308
1309static USHORT internal_downgrade(thread_db* tdbb, CheckStatusWrapper* statusVector, Lock* first)

Callers 4

enqueueMethod · 0.85
downgradeMethod · 0.85
dequeueMethod · 0.85
DEQUEUEFunction · 0.85

Calls 8

SET_TDBBFunction · 0.85
hash_remove_lockFunction · 0.85
bug_lckFunction · 0.85
internal_downgradeFunction · 0.85
getDatabaseMethod · 0.80
lockManagerMethod · 0.80
dequeueMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected