Assist proper thread synchronization when stopping the logger thread.
authorMark Michelson <mmichelson@digium.com>
Mon, 16 Feb 2009 18:25:57 +0000 (18:25 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 16 Feb 2009 18:25:57 +0000 (18:25 +0000)
commite32921415f2379ece4e10bce83f9e1d8da961f0d
treee3f4671de6bbede01ef41b1f719905f7bc3d7fb6
parent6cc10eb3513d9bd9cd9f73aa92afea7937e08a22
Assist proper thread synchronization when stopping the logger thread.

I was finding that on my dev box, occasionally attempting to "stop now" in
trunk would cause Asterisk to hang. I traced this to the fact that the logger
thread was waiting on a condition which had already been signalled. The logger
thread also need to be sure to check the value of the close_logger_thread variable.

The close_logger_thread variable is only checked when the list of logmessages is empty.
This allows for the logger thread to print and free any pending messages before exiting.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/logger.c