[asterisk-dev] ast_rdlock_contexts() does not perform a read lock

Byron Clark byron at theclarkfamily.name
Tue May 3 17:50:56 CDT 2011


While hunting a deadlock (issue #19191) I saw that ast_rdlock_contexts()
and ast_wrlock_contexts() both just call ast_mutex_lock(&conlock). From
the naming of the functions, I would expect them to actually use a
rwlock, in which case the deadlock I'm seeing wouldn't happen.

Is there some historical (or other) reason ast_rdlock_contexts() and
ast_wrlock_contexts() just use a pthread_mutex_t instead of a
pthread_rwlock_t? For reference, ast_rdlock_context() and
ast_wrlock_context() do use a rwlock.

-- 
Byron Clark



More information about the asterisk-dev mailing list