[Asterisk-Dev] ast_mutex_lock: How to test?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Oct 21 13:47:14 MST 2004


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.

-- 
Tilghman



More information about the asterisk-dev mailing list