Re-order cleanup
authorMatthew Jordan <mjordan@digium.com>
Tue, 16 Jul 2013 18:22:07 +0000 (18:22 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 16 Jul 2013 18:22:07 +0000 (18:22 +0000)
commit957f863dba85df0715e948f12984e81055485439
tree07ea9d40c261cc7fb1f180fce7a290ecb0f1da80
parent80dd0229f14c77db6c25fb5007bd4377631258c1
Re-order cleanup

This patch attempts to fix some possible race conditions in shutdown of the
CDR engine. It:
* Adds a cleanup handler to only unsubscribe and join on stasis messages during
  graceful shutdown. The cleanup handler should execute before the regular atexit
  handler, as we want to unsubscribe for any further messages before dispatching
  the CDRs.
* The CDRs are now locked when we dispatch them on shutdown.

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