[asterisk-dev] when to lock a channel

Russell Bryant russell at digium.com
Wed May 7 10:36:09 CDT 2008

lumen wrote:
> There is a way or notation to know if a function in channel.h, features.h or 
> whatever needs a channel lock previous to be called?

The doxygen documentation _should_ indicate that.  However, in most cases it
does not.  I have added it in some places, but there is more to do.  Patches to
improve the documentation are certainly welcome!

> There is a problem if many threads call ast_write(chan,frame) in the same 
> channel ?

No, ast_write() locks the channel.  However, I do wonder why you would ever
write code such that multiple threads are writing to the same channel ...

Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.

More information about the asterisk-dev mailing list