[Asterisk-Dev] no mutex_assert call ?
Luigi Rizzo
rizzo at icir.org
Tue Dec 20 01:21:05 MST 2005
just wondering - does anyone know if there is a way to know the
value of the "ownership counter" associated to a mutex ?
The fact that asterisk uses "recursive" (or "counting") mutexes
makes it possible to protect individual functions with
ast_mutex_lock()/ast_mutex_unlock() and not worry too much
about entering a section of code with the proper locking in
place. However, this makes it harder to know that we are
really releasing the mutex in places where, for deadlock
avoidance, we drop the lock, do something and reacquire the
lock.
Ideally one would put asserts in the code in those places,
but i cannot figure out how to fetch the value of the counter.
cheers
luigi
More information about the asterisk-dev
mailing list