Process outstanding log messages before shutting down the logger thread.

(closes issue #10933)
Reported by: sperreault


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 18 years ago
parent b4814719ff
commit d19257304e

@ -859,10 +859,6 @@ static void *logger_thread(void *data)
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 */
@ -877,6 +873,10 @@ static void *logger_thread(void *data)
/* Free the data since we are done */
free(msg);
}
/* If we should stop, then stop */
if (close_logger_thread)
break;
}
return NULL;
@ -937,6 +937,9 @@ void close_logger(void)
ast_cond_signal(&logcond);
AST_LIST_UNLOCK(&logmsgs);
if (logthread != AST_PTHREADT_NULL)
pthread_join(logthread, NULL);
AST_RWLIST_WRLOCK(&logchannels);
if (eventlog) {

Loading…
Cancel
Save