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

Function setEngineReleaseDelay

src/jrd/jrd.cpp:7918–7940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7916
7917
7918static void setEngineReleaseDelay(Database* dbb)
7919{
7920 if (!dbb->dbb_plugin_config)
7921 return;
7922
7923 time_t maxLinger = 0;
7924
7925 { // scope
7926 MutexLockGuard listGuardForLinger(databases_mutex, FB_FUNCTION);
7927
7928 for (Database* d = databases; d; d = d->dbb_next)
7929 {
7930 if (!d->dbb_attachments && (d->dbb_linger_end > maxLinger))
7931 maxLinger = d->dbb_linger_end;
7932 }
7933 }
7934
7935 ++maxLinger; // avoid rounding errors
7936 time_t t = time(NULL);
7937 FbLocalStatus s;
7938 dbb->dbb_plugin_config->setReleaseDelay(&s, maxLinger > t ? (maxLinger - t) * 1000 * 1000 : 0);
7939 check(&s);
7940}
7941
7942
7943bool JRD_shutdown_database(Database* dbb, const unsigned flags)

Callers 1

JRD_shutdown_databaseFunction · 0.85

Calls 2

checkFunction · 0.70
setReleaseDelayMethod · 0.45

Tested by

no test coverage detected