[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] mutex deadlocks

From: Simon MORLAT
Subject: Re: [Linphone-developers] mutex deadlocks
Date: Mon, 19 Jul 2004 16:00:08 +0200
User-agent: Mozilla Thunderbird 0.7.1 (X11/20040708)

Yes, I know this problem...
Unfortunately I have no simple solution, and as I'm moving to eXosip...
The main problem is those osipua callbacks that can be called from the osipua thread. They should be called by the main thread inside a osipua_main_loop()-like function.

Troy Cauble wrote:

The maintainers probably won't care because they're porting
to eXosip, but...

There appears to be ample opportunity for mutex deadlocks
in linphone.  The osipua lib and the coreapi module each
have mutexes.

The thread handling inbound SIP messages grabs the osipua
mutex then the coreapi mutex.  While the thread handling
user events grabs them in the opposite order.

Example:  Simultaneous hangup.

Processing the inbound BYE, osipua_distribute_event() grabs
the osipua mutex and results in a callback to bye_cb() which
tries for the linphone_core_lock().

But, the UI thread has already called linphone_core_terminate_dialog()
which has done linphone_core_lock() and osip_dialog_bye().
osip_dialog_bye() will result in ua_transaction_execute() which
tries for the osipua mutex.

I've hit this deadlock in my use of osipua with another UA (not linphone). I don't know why no one has complained about the problem
in osipua.  I guess a lot depends on the system load, luck, and the
scheduler used.  (I'm using the real time scheduler in Hardhat Linux.)


Linphone-developers mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]