Review Request: Workaround for non-thread-safety of QDBusConnection

Ralf Habacker ralf.habacker at freenet.de
Fri May 28 06:00:29 BST 2010


Am 28.05.2010 01:52, schrieb Thiago Macieira:
> Em Sexta-feira 28. Maio 2010, às 01.17.47, Lubos Lunak escreveu:
>    
>>   For example, openSUSE 11.3 is now entering RC phase and that means that
>> only  fixes can enter it, not features or newer non-patchlevel releases.
>> Since the fix is in 1.4.0 and openSUSE is at 1.2.8 IIRC, 1.4.0 cannot
>> enter openSUSE 11.3, neither now nor later. Now I know what the fix is and
>> I need to know what the actual problems are to evaluate and possibly
>> justify a request for exception to the rules. With the information given
>> so far the fix appears to be rather risky and not even remotely worth a
>> problem that has existed for quite a while and is "theoretical".
>>      
> It's not theoretical. It's quite easy to run into that issue: if the mutex is
> unlocked for a callback, the other thread will not be able to send the
> message. It will fail.
>
> I've seen krunner crashing because of this. That happens because the D-Bus
> calls are sent by several threads in response to the same event: the user
> typing.
>
> Anyway, QtDBus is resistant to the change and wouldn't have problems with the
> patch. The problem are other bindings and low-level apps.
>    
To enable such a specific fix for a specific binding would it not help 
to introduce something like cmake have with it's policy system 
http://www.itk.org/Wiki/CMake_Policies ?

May be something like

#define DBUS_API_POLICY_NON_THREAD_SAFETY_FIX 1
#define DBUS_API_POLICY_OTHER_POLICY 2
/**
set state of a given policy
@param policy to request
@param value for policy (0=off, 1=on)
@return 0 policy is not  set, 1 - policy is set
*/
void dbus_set_api_policy (int policy, int value);

/**
return state of a given policy
@param policy to request
@return 0 policy is not  set, 1 - policy is set
*/
int dbus_get_api_policy(int policy);

In QtDBus binding a call to  
dbus_set_api_policy(DBUS_API_POLICY_NON_THREAD_SAFETY_FIX,1)  would 
activate this specific fix

Regards
  Ralf





More information about the kde-core-devel mailing list