Add fiber features needed for to write an external scheduler:

- Allow yielding the main fiber. This exits the interpreter. The
  host can resume it by calling a method.
- Allow getting a reference to the current fiber.
This commit is contained in:
Bob Nystrom
2015-03-07 12:32:11 -08:00
parent 7aacf02a00
commit 05ba7d9fbf
7 changed files with 73 additions and 27 deletions
+3 -1
View File
@@ -1 +1,3 @@
Fiber.yield() // expect runtime error: No fiber to yield to.
IO.print("before") // expect: before
Fiber.yield()
IO.print("not reached")