]> 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:58:08 +0000 (23:58 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 22 Nov 2012 23:58:08 +0000 (23:58 +0000)
commitc4f013c5c828ba6c6b51a4537c9e070c5ee53bac
treed1bb633efcda6fad242604c7eb60fd9dc56a6bff
parent4c924bdce1c9ba88c0f6059e22053497fece7caf
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
........

Merged revisions 376587 from http://svn.asterisk.org/svn/asterisk/branches/10

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