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

Function blocking_ast_shadowing

src/jrd/sdw.cpp:1174–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1172
1173
1174static int blocking_ast_shadowing(void* ast_object)
1175{
1176/**************************************
1177 *
1178 * b l o c k i n g _ a s t _ s h a d o w i n g
1179 *
1180 **************************************
1181 *
1182 * Functional description
1183 * A blocking AST has been issued to give up
1184 * the lock on the shadowing semaphore.
1185 * Do so after flagging the need to check for
1186 * new shadow files before doing the next physical write.
1187 *
1188 **************************************/
1189 Database* const dbb = static_cast<Database*>(ast_object);
1190
1191 try
1192 {
1193 AsyncContextHolder tdbb(dbb, FB_FUNCTION);
1194
1195 SyncLockGuard guard(&dbb->dbb_shadow_sync, SYNC_EXCLUSIVE, "blocking_ast_shadowing");
1196
1197 dbb->dbb_ast_flags |= DBB_get_shadows;
1198
1199 Lock* const lock = dbb->dbb_shadow_lock;
1200
1201 if (LCK_read_data(tdbb, lock) & SDW_rollover)
1202 update_dbb_to_sdw(dbb);
1203
1204 LCK_release(tdbb, lock);
1205 }
1206 catch (const Firebird::Exception&)
1207 {} // no-op
1208
1209 return 0;
1210}
1211
1212
1213static bool check_for_file(thread_db* tdbb, const SCHAR* name, USHORT length)

Callers

nothing calls this directly

Calls 3

LCK_read_dataFunction · 0.85
update_dbb_to_sdwFunction · 0.85
LCK_releaseFunction · 0.85

Tested by

no test coverage detected