From 7f7f919d08031672f923a797e3a462a6f9312df8 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 31 May 2021 12:16:36 -0400 Subject: [PATCH] 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 --- src/bees-context.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bees-context.cc b/src/bees-context.cc index fe1020d..f4b03ae 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -1069,9 +1069,13 @@ BeesContext::stop() BEESLOGDEBUG("Waiting for progress thread"); m_progress_thread->join(); - // XXX: nobody can see this BEESNOTE because we are killing the - // thread that publishes it - BEESNOTE("waiting for status thread"); + // Write status once with this message... + BEESNOTE("stopping status thread at " << stop_timer << " sec"); + 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"); lock.lock(); m_stop_status = true;