mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 15:23:03 +01:00
Fix race in shutdown thread start (#8380)
Previously we assign value to shutdownSemaphore after shutdownThread is started, where it is already needed. So we can have situation where shutdownThread instantly leaving due to shutdownSemaphore == nullptr, and we are left with a server that can only be stopped with kill -9. Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
This commit is contained in:
parent
81bba14984
commit
b4e2ea4db3
@ -831,11 +831,11 @@ private:
|
|||||||
explicit CtrlCHandler(MemoryPool& p)
|
explicit CtrlCHandler(MemoryPool& p)
|
||||||
: ShutdownInit(p)
|
: ShutdownInit(p)
|
||||||
{
|
{
|
||||||
|
shutdownSemaphore = &semaphore;
|
||||||
Thread::start(shutdownThread, 0, 0, &handle);
|
Thread::start(shutdownThread, 0, 0, &handle);
|
||||||
|
|
||||||
procInt = ISC_signal(SIGINT, handlerInt, 0);
|
procInt = ISC_signal(SIGINT, handlerInt, 0);
|
||||||
procTerm = ISC_signal(SIGTERM, handlerTerm, 0);
|
procTerm = ISC_signal(SIGTERM, handlerTerm, 0);
|
||||||
shutdownSemaphore = &semaphore;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~CtrlCHandler()
|
~CtrlCHandler()
|
||||||
|
Loading…
Reference in New Issue
Block a user