Added an unwatch method, so that XendDomainInfo can unregister the watch from

outside the watch handler.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-16 15:27:59 +01:00
1 parent 1edf495b0f
commit 8676593f36
1 file changed
+5 -1
+5 -1
View File
@@ -22,6 +22,10 @@ class xswatch:
xs.watch(path, self)
def unwatch(self):
xs.unwatch(self.path, self)
watchThread = None
xs = None
xslock = threading.Lock()
@@ -49,7 +53,7 @@ def watchMain():
watch = we[1]
res = watch.fn(*watch.args, **watch.kwargs)
if not res:
xs.unwatch(watch.path, watch)
watch.unwatch()
except:
log.exception("read_watch failed")
# Ignore this exception -- there's no point throwing it
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.