Currently, thread shutdown relies on a invocation of the quit function from the threadmanager.
However, in the event of an emergency server shutdown, the server shutdown without invoking the quit function.
This leaves the thread orphaned and will later be sigkilled.
As a countermeasure, implement shutdown with locking of the main thread or implement emergency shutdown detector code.
Currently, thread shutdown relies on a invocation of the quit function from the threadmanager. However, in the event of an emergency server shutdown, the server shutdown without invoking the quit function. This leaves the thread orphaned and will later be sigkilled. As a countermeasure, implement shutdown with locking of the main thread or implement emergency shutdown detector code.