8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

Fixed bug CORE-5417 : Engine could hang up if auto-sweep is starting while database is shutting down

This commit is contained in:
hvlad 2016-12-11 22:26:34 +02:00
parent e2234cedc2
commit 51cb2c91b2

View File

@ -131,14 +131,19 @@ namespace Jrd
int Database::blocking_ast_sweep(void* ast_object)
{
Database* dbb = static_cast<Database*>(ast_object);
AsyncContextHolder tdbb(dbb, FB_FUNCTION);
if ((dbb->dbb_flags & DBB_sweep_starting) && !(dbb->dbb_flags & DBB_sweep_in_progress))
try
{
dbb->dbb_flags &= ~DBB_sweep_starting;
LCK_release(tdbb, dbb->dbb_sweep_lock);
Database* dbb = static_cast<Database*>(ast_object);
AsyncContextHolder tdbb(dbb, FB_FUNCTION);
if ((dbb->dbb_flags & DBB_sweep_starting) && !(dbb->dbb_flags & DBB_sweep_in_progress))
{
dbb->dbb_flags &= ~DBB_sweep_starting;
LCK_release(tdbb, dbb->dbb_sweep_lock);
}
}
catch (const Exception&)
{} // no-op
return 0;
}