[asterisk-dev] [Code Review] 1.6 sip deadlock fix

Nic Bellamy nicb-lists at vadacom.co.nz
Mon Jun 22 16:41:32 CDT 2009


Matthew Nicholson wrote:
>> On 2009-06-19 12:48:59, Russell Bryant wrote:
>>     
>>> /branches/1.6.2/channels/chan_sip.c, line 5788
>>> <http://reviewboard.digium.com/r/287/diff/1/?file=5713#file5713line5788>
>>>
>>>     Is there a good reason to use usleep(1) instead of sched_yield()?
>>>       
>
> I don't know of any good reason.
>
> This link has something to say about the subject:
> http://www.technovelty.org/code/c/sched_yield.html
>   

That page has an interesting approach to the problem, and I can see 
where they're coming from - but it's worth noting that it is locking a 
mutex from one thread, and unlocking it from a different thread, which 
is disallowed by the standard, non-portable, and will result in 
pthread_mutex_unlock returning EPERM if error-checking mutexes are being 
used.

Pity. It was kinda neat ;-)

Cheers,
    Nic.

-- 
Nic Bellamy,
Head Of Engineering, Vadacom Ltd - http://www.vadacom.co.nz/




More information about the asterisk-dev mailing list