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

Function internal_ast

src/jrd/lck.cpp:1184–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1182
1183
1184static void internal_ast(Lock* lock)
1185{
1186/**************************************
1187 *
1188 * i n t e r n a l _ a s t
1189 *
1190 **************************************
1191 *
1192 * Functional description
1193 * Deliver blocking asts to all locks identical to
1194 * the passed lock. This routine is called to downgrade
1195 * all other locks in the same process which do not have
1196 * the lck_compatible field set.
1197 * Note that if this field were set, the internal lock manager
1198 * should not be able to generate a lock request which blocks
1199 * on our own process.
1200 *
1201 **************************************/
1202 fb_assert(LCK_CHECK_LOCK(lock));
1203
1204 // go through the list, saving the next lock in the list
1205 // in case the current one gets deleted in the ast
1206
1207 Lock* next;
1208 for (Lock* match = hash_get_lock(lock, 0, 0); match; match = next)
1209 {
1210 next = match->lck_identical;
1211
1212 // don't deliver the ast to any locks which are already compatible
1213
1214 if (match != lock && !compatible(match, lock, lock->lck_logical) && match->lck_ast)
1215 {
1216 (*match->lck_ast)(match->lck_object);
1217 }
1218 }
1219}
1220
1221
1222

Callers 1

internal_compatibleFunction · 0.85

Calls 2

hash_get_lockFunction · 0.85
compatibleFunction · 0.85

Tested by

no test coverage detected