ia64/xen-unstable

changeset 7862:3631592ad7d3

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

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Nov 16 15:27:59 2005 +0100 (2005-11-16)
parents 8c736c042f72
children 32b574b24b18
files tools/python/xen/xend/xenstore/xswatch.py
line diff
     1.1 --- a/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 16 15:27:11 2005 +0100
     1.2 +++ b/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 16 15:27:59 2005 +0100
     1.3 @@ -22,6 +22,10 @@ class xswatch:
     1.4          xs.watch(path, self)
     1.5  
     1.6  
     1.7 +    def unwatch(self):
     1.8 +        xs.unwatch(self.path, self)
     1.9 +
    1.10 +
    1.11  watchThread = None
    1.12  xs = None
    1.13  xslock = threading.Lock()
    1.14 @@ -49,7 +53,7 @@ def watchMain():
    1.15              watch = we[1]
    1.16              res = watch.fn(*watch.args, **watch.kwargs)
    1.17              if not res:
    1.18 -                xs.unwatch(watch.path, watch)
    1.19 +                watch.unwatch()
    1.20          except:
    1.21              log.exception("read_watch failed")
    1.22              # Ignore this exception -- there's no point throwing it