[Asterisk-Dev] ast_mutex_lock/unlock usage

David C. Troy dave at toad.net
Tue Sep 9 14:54:26 MST 2003


Mark et al,

I have been doing some enhancements to app_queue;  I have some idea of 
when it is appropriate/necessary to use ast_mutex_lock to lock a queue 
and/or queue_entry, but I am not getting a consistent feeling for when 
it's strictly necessary.

I am doing it whenever I think to myself 1) gee, it'd be really bad if 
the object that this pointer references goes away while I am doing this, 
2) this is all really fast stuff that isn't going to tie things up (i.e. 
playing sounds inside of a lock seems bad, but doing some quick math 
and setting a queue property seems good).

What other guidelines should I be using for this?

Thanks,
Dave

=====================================================================
David C. Troy   [dave at toad.net]                   410-384-2500 Sales
ToadNet - Want to go fast?                        410-544-1329 FAX
570 Ritchie Highway, Severna Park, MD 21146-2925  www.toad.net




More information about the asterisk-dev mailing list