[asterisk-commits] simon.perreault: branch group/v6 r84777 - /team/group/v6/trunk/main/logger.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 5 09:47:05 CDT 2007
Author: simon.perreault
Date: Fri Oct 5 09:47:04 2007
New Revision: 84777
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84777
Log:
Make sure all log messages are out before closing the log thread.
Modified:
team/group/v6/trunk/main/logger.c
Modified: team/group/v6/trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/team/group/v6/trunk/main/logger.c?view=diff&rev=84777&r1=84776&r2=84777
==============================================================================
--- team/group/v6/trunk/main/logger.c (original)
+++ team/group/v6/trunk/main/logger.c Fri Oct 5 09:47:04 2007
@@ -859,10 +859,6 @@
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 @@
/* Free the data since we are done */
free(msg);
}
+
+ /* If we should stop, then stop */
+ if (close_logger_thread)
+ break;
}
return NULL;
@@ -936,6 +936,8 @@
close_logger_thread = 1;
ast_cond_signal(&logcond);
AST_LIST_UNLOCK(&logmsgs);
+ if (logthread != AST_PTHREADT_NULL)
+ pthread_join(logthread, NULL);
AST_RWLIST_WRLOCK(&logchannels);
More information about the asterisk-commits
mailing list