; cancel only requests: the child sees the flag, returns, and must still be joined. ; expect: run ; schedules: 10 ; result: 7 ; phase: 3 ; spec: docs/spec/04-concurrency-and-atomics.md module test.tasks_cancel_request air 0 lang 0.1 features [arrays, ownership, tasks] fn @main() -> u8 effects [task.spawn] entry: %sc = task.scope.begin %t = task.spawn %sc, @worker() task.cancel %t %r = task.join %t task.scope.end %sc ret %r fn @worker() -> u8 effects [] entry: br @poll() poll: %c = task.cancelled cbr %c, @stop(), @poll() stop: %v = const.u8 7 ret %v