From 8eed56961481bded395005cfd1729c045c23b289 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 6 May 2011 22:54:48 +0200 Subject: rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime() --- src/pulsecore/core-util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/pulsecore') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index f769b325..6902ee98 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -661,7 +661,7 @@ static int set_scheduler(int rtprio) { #ifdef HAVE_DBUS /* Try to talk to RealtimeKit */ - if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) { + if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) { pa_log("Failed to connect to system bus: %s\n", error.message); dbus_error_free(&error); errno = -EIO; @@ -674,6 +674,7 @@ static int set_scheduler(int rtprio) { dbus_connection_set_exit_on_disconnect(bus, FALSE); r = rtkit_make_realtime(bus, 0, rtprio); + dbus_connection_close(bus); dbus_connection_unref(bus); if (r >= 0) { -- cgit