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

Paul Menzel paulepanter at users.sourceforge.net
Mon Mar 12 16:19:06 PDT 2012


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

> 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?

> +        goto finish;
> +    }
> +
>      if (start_server) {
>  #endif
>          if (conf->load_default_script_file) {

Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20120313/bcea4936/attachment.pgp>


More information about the pulseaudio-discuss mailing list