]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Re-initialize logmsgs mutex upon logger initialization to prevent lock errors
authorMatthew Jordan <mjordan@digium.com>
Thu, 22 Nov 2012 23:56:00 +0000 (23:56 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 22 Nov 2012 23:56:00 +0000 (23:56 +0000)
commitd26baf0d56895a474e7ae707bf037e1ce69e0b80
tree94e28892e401a47d5668b02ce90ea5cd367ec9d6
parent686d198ab2749df3b4f9441cd24d0dd5513fd069
Re-initialize logmsgs mutex upon logger initialization to prevent lock errors

Similar to the patch that moved the fork earlier in the startup sequence to
prevent mutex errors in the recursive mutex surrounding the read/write thread
registration lock, this patch re-initializes the logmsgs mutex.  Part of the
start up sequence before forking the process into the background includes
reading asterisk.conf; this has to occur prior to the call to daemon in order
to read startup parameters.  When reading in a conf file, log statements can
be generated.  Since this can't be avoided, the mutex instead is
re-initialized to ensure a reset of any thread tracking information.

This patch also includes some additional debugging to catch errors when
locking or unlocking the recursive mutex that surrounds locks when the
DEBUG_THREADS build option is enabled.  DO_CRASH or THREAD_CRASH will
cause an abort() if a mutex error is detected.

(issue ASTERISK-19463)
Reported by: mjordan
Tesetd by: mjordan
........

Merged revisions 376586 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@376587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/lock.h
main/lock.c
main/logger.c