Review Board 1.7.16

Debug threads: avoid double-initialization of lock tracking

Review Request #2826 - Created Sept. 5, 2013 and submitted

David Lee
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.
I propose we setup Bamboo to run the TestSuite with DEBUG_THREADS
enabled on this branch nightly for a few weeks.
Review request changed
Updated (Dec. 19, 2014, 2:36 p.m.)
  • changed from pending to submitted
Committed in revision 429859 runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to