Simplify housekeeper shutdown

The two-part shutdown procedure for the housekeeper was not needed and
caused problems if SIGINT wasn't raised. Since the main thread returns to
the main function, a single shutdown function is all that the housekeeper
needs to function.

Moved all the shutdown related code into Housekeeper::stop to remove the
waiting for the thread in the destructor.
This commit is contained in:
Markus Mäkelä
2018-04-26 23:37:57 +03:00
parent df1fc49ac3
commit 59165b8dd5
3 changed files with 10 additions and 28 deletions

View File

@ -45,17 +45,7 @@ typedef bool (*TASKFN)(void *data);
bool hkinit();
/**
* Shuts down the housekeeper mechanism.
*
* Should be called @b only if @c hkinit() returned successfully.
*
* @see hkinit hkfinish
*/
void hkshutdown();
/**
* Waits for the housekeeper thread to finish. Should be called only after
* hkshutdown() has been called.
* Waits for the housekeeper thread to finish.
*/
void hkfinish();