mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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:
1 parent
1edf495b0f
commit
8676593f36
1 file changed
+5
-1
@@ -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
|
||||
|
||||