[Asterisk-Dev] Fundamental locking (race/deadlock) problem in ast_hangup()

Sergio Chersovani mlists at c-net.it
Thu Aug 25 05:24:27 MST 2005


Kristian Nielsen ha scritto:

>is totally bogus, IMO. If another thread should be waiting for the lock,
>it will immediately die when ast_hangup() unlocks chan->lock and calls
>ast_channel_free().
>  
>
In my point of view using pointers as param is dangerous in the channels 
context.
Maybe a fixed array of structs (ast_channel pointer and lock) would be 
better.
The param would be just an index so we could lock the channel before 
getting its pointer (maybe NULL). A free() could be called while we are 
waiting for the lock in a different thread.

Sergio




More information about the asterisk-dev mailing list