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

Function notify_shutdown

src/jrd/shut.cpp:467–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465
466
467static bool notify_shutdown(thread_db* tdbb, SSHORT flag, SSHORT delay, Sync* guard)
468{
469/**************************************
470 *
471 * n o t i f y _ s h u t d o w n
472 *
473 **************************************
474 *
475 * Functional description
476 * Notify database users that shutdown
477 * status of a database is changing.
478 * Pulse database lock and pass shutdown
479 * flags and delay via lock data.
480 *
481 **************************************/
482 Database* const dbb = tdbb->getDatabase();
483
484 shutdown_data data;
485 data.data_items.flag = flag;
486 data.data_items.delay = delay;
487
488 if (dbb->isRestoring())
489 data.data_items.flag |= SHUT_flag_restoring;
490
491 LCK_write_data(tdbb, dbb->dbb_lock, data.data_long);
492
493 { // scope
494 // Checkout before calling AST function
495 EngineCheckout uguard(tdbb, FB_FUNCTION);
496
497 // Notify local attachments
498 SHUT_blocking_ast(tdbb, true);
499 }
500
501 // Send blocking ASTs to other database users
502
503 return CCH_exclusive(tdbb, LCK_PW, -1, guard);
504}
505
506
507static bool shutdown(thread_db* tdbb, SSHORT flag, bool force)

Callers 2

SHUT_databaseFunction · 0.85
SHUT_onlineFunction · 0.85

Calls 5

LCK_write_dataFunction · 0.85
SHUT_blocking_astFunction · 0.85
CCH_exclusiveFunction · 0.85
getDatabaseMethod · 0.80
isRestoringMethod · 0.80

Tested by

no test coverage detected