[asterisk-dev] Proper use of locking.

Russell Bryant russell at digium.com
Wed Jul 18 16:43:40 CDT 2007


Kevin P. Fleming wrote:
> Asterisk has always required and used recursive (reentrant is not the
> right word) mutex locks (and now rwlocks, in trunk). All the code in
> Asterisk that uses locks depends on this behavior and would break badly
> if the mutexes were not recursive. This is documented in a comment very
> early in include/asterisk/lock.h, so I'm not sure why you came to the
> conclusion that non-recursive mutexes were in use.

Just as a related comment, the rwlocks aren't recursive, because they
don't support it.  But *all* mutexes in Asterisk are defined as
recursive, as you stated.

-- 
Russell Bryant
Software Engineer
Digium, Inc.



More information about the asterisk-dev mailing list