AST_LIST_HEAD_INIT_NOLOCK(&logmsgs);
AST_LIST_UNLOCK(&logmsgs);
- /* If we should stop, then stop */
- if (close_logger_thread)
- break;
-
/* Otherwise go through and process each message in the order added */
while ((msg = next)) {
/* Get the next entry now so that we can free our current structure later */
/* Free the data since we are done */
free(msg);
}
+
+ /* If we should stop, then stop */
+ if (close_logger_thread)
+ break;
}
return NULL;
ast_cond_signal(&logcond);
AST_LIST_UNLOCK(&logmsgs);
+ if (logthread != AST_PTHREADT_NULL)
+ pthread_join(logthread, NULL);
+
AST_RWLIST_WRLOCK(&logchannels);
if (eventlog) {