Wait until housekeeper has finished
When calling hkshutdown(), only a shutdown flag will be set. In main() we will then actually wait for the housekeeper thread to finish before exiting.
This commit is contained in:
@ -1936,7 +1936,13 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
* Start the housekeeper thread
|
||||
*/
|
||||
hkinit();
|
||||
if (!hkinit())
|
||||
{
|
||||
char* logerr = "Failed to start housekeeper thread.";
|
||||
print_log_n_stderr(true, true, logerr, logerr, 0);
|
||||
rc = MAXSCALE_INTERNALERROR;
|
||||
goto return_main;
|
||||
}
|
||||
|
||||
/*<
|
||||
* Start the polling threads, note this is one less than is
|
||||
@ -1974,6 +1980,11 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
poll_waitevents((void *)0);
|
||||
|
||||
/*<
|
||||
* Wait for the housekeeper to finish.
|
||||
*/
|
||||
hkfinish();
|
||||
|
||||
/*<
|
||||
* Wait server threads' completion.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user