[Asterisk-Dev] no mutex_assert call ?

Kevin P. Fleming kpfleming at digium.com
Tue Dec 20 05:52:11 MST 2005


Olle E Johansson wrote:

> Check my patches for ast_channel_lock in the issue tracker.
> I use the counter for debugging messages in Linux. In FreeBSd, I could 
> not find it.

Right, it's very implementation specific.

Turning on DEBUG_THREADS adds Asterisk-specific wrappers around the 
mutexes, and those wrappers _do_ watch the count and ensure that we 
don't try to unlock a lock that is not locked (or not locked by this 
thread), etc. Enhancements to the DEBUG_THREADS code are always welcome; 
  I have a project on my board to enhance them to use Thread Local 
Storage (TLS) to track which locks are owned by a thread, with the hope 
that in a core dump we'll actually be able to see that information easily.



More information about the asterisk-dev mailing list