Skip to content

Commit

Permalink
dbus: init glib threading during DBusMainLoopTask init
Browse files Browse the repository at this point in the history
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
  • Loading branch information
bboozzoo committed Apr 3, 2015
1 parent 749f0db commit 980cea7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sparts/tasks/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
import glib
import time

# always init threads before calling any dbus code
glib.threads_init()
gobject.threads_init()
dbus.mainloop.glib.threads_init()


class VServiceDBusObject(dbus.service.Object):
"""DBus interface implementation that exports common VService methods"""
Expand Down Expand Up @@ -110,6 +105,11 @@ def initTask(self):
if not needed:
raise SkipTask("No DBusTasks found or enabled")

# always init threads before calling any dbus code
glib.threads_init()
gobject.threads_init()
dbus.mainloop.glib.threads_init()

self.dbus_loop = DBusGMainLoop(set_as_default=True)
# using main loop with default context
self.mainloop = gobject.MainLoop()
Expand Down

0 comments on commit 980cea7

Please sign in to comment.