rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime()

This commit is contained in:
Lennart Poettering 2011-05-06 22:54:48 +02:00
parent 320b70e94e
commit 8eed569614

View 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) {