Allow only one thread at a time to do asterisk cleanup/shutdown.
authorWalter Doekes <walter+asterisk@wjd.nu>
Sun, 15 Jan 2012 20:16:08 +0000 (20:16 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Sun, 15 Jan 2012 20:16:08 +0000 (20:16 +0000)
commitef0de1358d22502e6e202f300e4669427361c6aa
treef588f91f055ffa03ad2ac9db6d347a1e5fde5924
parentb84c0aabd490c994368d847bcac876a49195bd8f
Allow only one thread at a time to do asterisk cleanup/shutdown.

Add locking around the really-really-quit part of the core stop/restart
part. Previously more than one thread could be called to do cleanup,
causing atexit handlers to be run multiple times, in turn causing
segfaults.

(issue ASTERISK-18883)
Reviewed by: Terry Wilson
Review: https://reviewboard.asterisk.org/r/1662/
Review: https://reviewboard.asterisk.org/r/1658/
........

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

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

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