Move the registration of the @releaseDomain watch so that we avoid a watch

between the watch firing and the first call to refresh. 

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-16 15:27:11 +01:00
1 parent c3381a8dac
commit 1edf495b0f
1 file changed
+7 -2
+7 -2
View File
@@ -63,14 +63,19 @@ class XendDomain:
self.domains = {}
self.domains_lock = threading.RLock()
xswatch("@releaseDomain", self.onReleaseDomain)
self.domains_lock.acquire()
try:
self._add_domain(
XendDomainInfo.recreate(self.xen_domains()[PRIV_DOMAIN],
True))
self.dom0_setup()
# This watch registration needs to be before the refresh call, so
# that we're sure that we haven't missed any releases, but inside
# the domains_lock, as we don't want the watch to fire until after
# the refresh call has completed.
xswatch("@releaseDomain", self.onReleaseDomain)
self.refresh(True)
finally:
self.domains_lock.release()
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.