[asterisk-dev] [Code Review] 2826: Debug threads: avoid double-initialization of lock tracking

David Lee reviewboard at asterisk.org
Fri Dec 12 17:31:42 CST 2014

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 12, 2014, 5:31 p.m.)


This change has been marked as submitted.

Review request for Asterisk Developers and Matt Jordan.


Committed in revision 429539

Bugs: ASTERISK-19463

Repository: Asterisk


This patch corrects a consistency issue with debug threads that I
noticed while fixing ASTERISK-22455.

The initialization of a mutex's lock tracking structure was not
protected in a critical section. This is fine for any mutex that is
explicitly initialized, but a static mutex may have its lock tracking
double-initialized if multiple threads attempt the first lock

This patch creates a global mutex to properly serialize the
initialization of the lock tracking structure for a mutex. It also
changes lock.c to properly handle allocation failures of the lock
tracking structure.


  /branches/1.8/main/lock.c 398421 
  /branches/1.8/include/asterisk/lock.h 398421 

Diff: https://reviewboard.asterisk.org/r/2826/diff/


I propose we setup Bamboo to run the TestSuite with DEBUG_THREADS
enabled on this branch nightly for a few weeks.


David Lee

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141212/36d1feab/attachment-0001.html>

More information about the asterisk-dev mailing list