]> code.delx.au - pulseaudio/commitdiff
rtkit: use private bus connection in order to avoid threading issues when invoking...
authorLennart Poettering <lennart@poettering.net>
Fri, 6 May 2011 20:54:48 +0000 (22:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 6 May 2011 21:09:54 +0000 (23:09 +0200)
src/pulsecore/core-util.c

index f769b3252567e6a300d2079b694f2c14dac3752b..6902ee98e145ec0a190c09914c827c0142645792 100644 (file)
@@ -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) {