Fix log manager race condition

The log manager could send two messages if a log message was posted soon
before the log manager was stopped. This caused a debug assertion which
then manifested as a deadlock inside the log manager.
This commit is contained in:
Markus Mäkelä
2018-01-03 16:07:21 +02:00
parent e0a584a626
commit e9fceff8ce
3 changed files with 16 additions and 5 deletions

View File

@ -436,7 +436,9 @@ bool skygw_thread_set_exitflag(skygw_thread_t* thr, skygw_message_t* sendmes,
skygw_message_wait(recmes);
}
ss_dassert(simple_mutex_lock(thr->sth_mutex, true) == 0);
ss_dassert(thr->sth_state == THR_STOPPED);
ss_dassert(simple_mutex_unlock(thr->sth_mutex) == 0);
return_succp:
return succp;