mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1461 (428c649aJ3imCLGJhIeU9ADXW51cWw)
Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
This commit is contained in:
commit
418babe999
4 files changed
+6
-12
No files matched your search
@@ -1,9 +1,2 @@
|
||||
from threading import Timer
|
||||
|
||||
from unix import listenUNIX, connectUNIX
|
||||
from tcp import listenTCP, connectTCP
|
||||
|
||||
def callLater(_delay, _fn, *args, **kwds):
|
||||
timer = Timer(_delay, _fn, args=args, kwargs=kwds)
|
||||
timer.start()
|
||||
return timer
|
||||
@@ -5,8 +5,7 @@
|
||||
import string
|
||||
from threading import Lock
|
||||
|
||||
#from twisted.internet import reactor
|
||||
from xen.web import reactor
|
||||
import scheduler
|
||||
|
||||
# subscribe a.b.c h: map a.b.c -> h
|
||||
# subscribe a.b.* h: map a.b.* -> h
|
||||
@@ -130,7 +129,7 @@ class EventServer:
|
||||
self.lock.release()
|
||||
|
||||
if async:
|
||||
reactor.callLater(0, self.call_handlers, event, val)
|
||||
scheduler.now(self.call_handlers, [event, val])
|
||||
else:
|
||||
self.call_handlers(event, val)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import types
|
||||
from xen.web import reactor
|
||||
from xen.web.protocol import Protocol, ClientFactory
|
||||
|
||||
import scheduler
|
||||
import sxp
|
||||
import XendDB
|
||||
import EventServer; eserver = EventServer.instance()
|
||||
@@ -120,7 +121,7 @@ class SuspendHandler:
|
||||
|
||||
def start(self):
|
||||
self.subscribe(on=True)
|
||||
timer = reactor.callLater(self.timeout, self.onTimeout)
|
||||
timer = scheduler.later(self.timeout, self.onTimeout)
|
||||
try:
|
||||
self.readyCond.acquire()
|
||||
while not self.ready:
|
||||
|
||||
@@ -3,6 +3,7 @@ import StringIO
|
||||
|
||||
from xen.web import reactor, protocol
|
||||
|
||||
from xen.xend import scheduler
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend import EventServer; eserver = EventServer.instance()
|
||||
@@ -47,7 +48,7 @@ class EventProtocol(protocol.Protocol):
|
||||
if self.transport:
|
||||
self.transport.loseConnection()
|
||||
if self.connected:
|
||||
reactor.callLater(0, self.connectionLost)
|
||||
scheduler.now(self.connectionLost)
|
||||
|
||||
def connectionLost(self, reason=None):
|
||||
self.unsubscribe()
|
||||
|
||||