Move download management from frontends to rss_sqlite.py.
[feedingit] / src / updatedbus.py
index e712c7e..8e110ae 100644 (file)
 
 import dbus
 import dbus.service
+import mainthread
 
+@mainthread.mainthread
 def get_lock(key):
     try:
         bus_name = dbus.service.BusName('org.marcoz.feedingit.lock_%s' %key,bus=dbus.SessionBus(), do_not_queue=True)
     except:
         bus_name = None
     return bus_name
-    
+
+def release_lock(lock):
+    assert lock is not None
+    mainthread.execute(lock.__del__, async=True)
 
 class UpdateServerObject(dbus.service.Object):
     def __init__(self, app):