From e74b4d384dacdaf85e310671749094cfc04772e2 Mon Sep 17 00:00:00 2001 From: hvlad Date: Tue, 24 Nov 2015 23:33:13 +0000 Subject: [PATCH] Fixed bug CORE-5034 : At least 5 seconds delay on disconnect could happen if disconnect happens close after Event Manager initialization --- src/jrd/event.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/jrd/event.cpp b/src/jrd/event.cpp index 636deb2689..6a7a21448f 100644 --- a/src/jrd/event.cpp +++ b/src/jrd/event.cpp @@ -1400,13 +1400,24 @@ void EventManager::watcher_thread() (void) m_sharedMemory->eventWait(&m_process->prb_event, value, 0); } - - m_cleanupSemaphore.release(); } catch (const Firebird::Exception& ex) { iscLogException("Error in event watcher thread\n", ex); } + + try + { + if (startup) + { + m_startupSemaphore.release(); + } + m_cleanupSemaphore.release(); + } + catch (const Firebird::Exception& ex) + { + iscLogException("Error closing event watcher thread\n", ex); + } } } // namespace