[PATCH] daemon: Initialize dbus to use thread-safe mode by default

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

 



On 03/13/2012 12:19 AM, Paul Menzel wrote:
> Dear David,
>
>
> Am Dienstag, den 13.03.2012, 00:06 +0100 schrieb David Henningsson:
>> In most cases, we use dbuus from more than one thread, as we
>
> s/dbuus/dbus/
>
> or D-Bus

Yeah, saw that just as I posted the patch. My stupid touchpad moves my 
mouse pointer when I don't want it to, and so I end up writing 
characters in the wrong location. Usually I discover it and undo it, but 
not this time it seems.

>
>> e g enable real-time scheduling from the ALSA threads.
>> Therefore set dbus to thread-safe mode by default, as recommended
>> in https://bugs.freedesktop.org/show_bug.cgi?id=47060#c5
>>
>> This fixes a bug where PulseAudio could crash in two parallel
>> calls to pa_make_realtime.
>>
>> BugLink: https://bugs.launchpad.net/bugs/937933
>> Signed-off-by: David Henningsson<david.henningsson at canonical.com>
>> ---
>>   src/daemon/main.c |    5 +++++
>>   1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/daemon/main.c b/src/daemon/main.c
>> index 19933e3..3374196 100644
>> --- a/src/daemon/main.c
>> +++ b/src/daemon/main.c
>> @@ -1066,6 +1066,11 @@ int main(int argc, char *argv[]) {
>>       buf = pa_strbuf_new();
>>
>>   #ifdef HAVE_DBUS
>> +    if (!dbus_threads_init_default()) {
>> +        pa_log("dbus_threads_init_default() failed.");
>
> Is that going to be in the default log level output? If yes the message
> should be more elaborate. Is there a place this is described? Or can
> that only fail if the D-Bus configuration is totally messed up?

The latter. According to the bug comment this is likely only happening 
on OOM.

>
>> +        goto finish;
>> +    }
>> +
>>       if (start_server) {
>>   #endif
>>           if (conf->load_default_script_file) {
>
> Reviewed-by: Paul Menzel<paulepanter at users.sourceforge.net>
>
>
> Thanks,
>
> Paul
>
>
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss



-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux