[Asterisk-Dev] ast_mutex_lock: How to test?

Chris Stenton jacs at gnome.co.uk
Mon Oct 25 00:59:19 MST 2004


On Thu, 2004-10-21 at 21:47, Tilghman Lesher wrote:
> On Thursday 21 October 2004 14:01, Matthew Boehm wrote:
> <snip>
> > ?? Is that right? If so, what is the correct way for the same thread to
> > test if there is a lock already?
> 
> 1) Mutexes in Asterisk are recursive.
> 2) You're using a single threaded test implementation, so the locking code
> sees the mutex locked by the same thread (thus allowing it).
> 3) There is no spoon.

Have a look at test_for_thread_safety in asterisk.






More information about the asterisk-dev mailing list