]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Prevent multiple CDR batches from conflicting when scheduling the CDR write
authorMatthew Jordan <mjordan@digium.com>
Sat, 3 Nov 2012 23:52:54 +0000 (23:52 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sat, 3 Nov 2012 23:52:54 +0000 (23:52 +0000)
commit69777a9376bd2c03b90b3e92130d511d0974b6d0
tree0089cdf74fa54a1a9aada6a06a40bb94e68a0dc6
parent794eb780909124bbfe140214c281ab237ea2bbf0
Prevent multiple CDR batches from conflicting when scheduling the CDR write

The Asterisk Test Suite caught an error condition where a scheduled CDR batch
write can be deleted twice if two channels attempt to post their CDRs at the
same time.  The batch CDR mutex is locked while the CDRs are appended to the
current batch list; however, it is unlocked prior to actually scheduling the
CDR write.  As such, two threads can attempt to remove the currently scheduled
batch write at the same time, resulting in an assertion error.

This patch extends the time that the mutex is locked to encompass actually
scheduling the write.  This prevents two threads from unscheduling the
currently scheduled write at the same time.
........

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

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

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