|
@@ -15,9 +15,10 @@ class InterpretedFunctionFinished(Exception):
|
|
|
|
|
|
class SleepKernel(Exception):
|
|
|
"""Exception to indicate the kernel to sleep for some time."""
|
|
|
- def __init__(self, timeout):
|
|
|
+ def __init__(self, timeout, interruptable):
|
|
|
Exception.__init__(self)
|
|
|
self.timeout = timeout
|
|
|
+ self.interruptable = interruptable
|
|
|
|
|
|
# Functions annotated with __exception_return use the JIT's calling convention instead of
|
|
|
# the kernel's: returns are handled by throwing a PrimitiveFinished exception; the caller's
|
|
@@ -534,7 +535,7 @@ def hash(a, **remainder):
|
|
|
b, = yield [("CNV", [b_value])]
|
|
|
raise PrimitiveFinished(b)
|
|
|
|
|
|
-def __sleep(a, **remainder):
|
|
|
- timeout, = yield [("RV", [a])]
|
|
|
- yield [("SLEEP", [timeout, False])]
|
|
|
+def __sleep(a, b, **remainder):
|
|
|
+ timeout, interruptable = yield [("RV", [a]), ("RV", [b])]
|
|
|
+ yield [("SLEEP", [timeout, interruptable])]
|
|
|
raise PrimitiveFinished(a)
|