1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

context: fix the status message that will never be seen

BEESNOTE can only be seen if the status thread is running at the time,
making the log of activities during shutdown incomplete.

Wake up the status thread early during shutdown so the logged sequence
of shutdown actions is complete.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2021-05-31 12:16:36 -04:00
parent 11fabd66a8
commit 7f7f919d08

View File

@ -1069,9 +1069,13 @@ BeesContext::stop()
BEESLOGDEBUG("Waiting for progress thread"); BEESLOGDEBUG("Waiting for progress thread");
m_progress_thread->join(); m_progress_thread->join();
// XXX: nobody can see this BEESNOTE because we are killing the // Write status once with this message...
// thread that publishes it BEESNOTE("stopping status thread at " << stop_timer << " sec");
BEESNOTE("waiting for status thread"); lock.lock();
m_stop_condvar.notify_all();
lock.unlock();
// then wake the thread up one more time to exit the while loop
BEESLOGDEBUG("Waiting for status thread"); BEESLOGDEBUG("Waiting for status thread");
lock.lock(); lock.lock();
m_stop_status = true; m_stop_status = true;