Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
    void x() {
        try (var scope1 = FiberScope.open()) {
            var fiber1 = scope1.schedule(() -> foo());
            var fiber2 = scope1.schedule(() -> bar());
        }
    }
    void foo() {
        try (var scope2 = FiberScope.open()) {
            scope2.schedule(() -> task());
            scope2.schedule(() -> task());
        }
    }
    void bar() {
        try (var scope3 = FiberScope.cancellableopen()) {
            scope3.schedule(() -> task());
            scope3.schedule(() -> task());
        }
    }    

...