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

Fixed possible deadlock between the shutting down engine and the running service. Reported by RedSoft.

This commit is contained in:
dimitr 2011-04-15 16:35:00 +00:00
parent 9087961c15
commit 05c2144ac1

View File

@ -6149,18 +6149,20 @@ static THREAD_ENTRY_DECLARE shutdown_thread(THREAD_ENTRY_PARAM arg)
{
ThreadContextHolder tdbb;
MutexLockGuard guard(databases_mutex);
{ // scope
MutexLockGuard guard(databases_mutex);
cancel_attachments();
cancel_attachments();
Database* dbb_next;
for (Database* dbb = databases; dbb; dbb = dbb_next)
{
dbb_next = dbb->dbb_next;
if (!shutdown_dbb(tdbb, dbb))
Database* dbb_next;
for (Database* dbb = databases; dbb; dbb = dbb_next)
{
success = false;
break;
dbb_next = dbb->dbb_next;
if (!shutdown_dbb(tdbb, dbb))
{
success = false;
break;
}
}
}