Closed
Description
void AsyncChannel::close()
{
if (_thread.isRunning())
{
while (!_queue.empty()) Thread::sleep(100);
do
{
_queue.wakeUpAll();
}
while (!_thread.tryJoin(100));
}
}
close() -> thread.isRunning() -> true
[thread context change]
some thread calling log().. exec until _queue.enqueue
[thread context change]
AsyncChannel thread finishes...
[thread context change]
close() -> while (!_queue.empty()) -> thread stuck
edit:
this can also cause shutdown issues in the following scenario:
main thread calls exit()
singleton Logger shutdown
other thread logging something
AsyncChannel creates the thread again
AsyncChannel has still some work while main thread destroys stuff with exit()
-> segfault