| 1 |
(module |
| 2 |
(type $func (;0;) (func)) |
| 3 |
(type $cont (;1;) (cont $func)) |
| 4 |
(type (;2;) (func (param (ref $cont)))) |
| 5 |
(type (;3;) (func (param i32))) |
| 6 |
(import "scheduler" "run" (func $scheduler (;0;) (type $func))) |
| 7 |
(import "queue" "enqueue" (func $enqueue (;1;) (type 2))) |
| 8 |
(import "spectest" "print_i32" (func $log (;2;) (type 3))) |
| 9 |
(import "example" "thread1" (func $thread1 (;3;) (type $func))) |
| 10 |
(import "example" "thread2" (func $thread2 (;4;) (type $func))) |
| 11 |
(import "example" "thread3" (func $thread3 (;5;) (type $func))) |
| 12 |
(export "run" (func 6)) |
| 13 |
(elem (;0;) declare func $thread1 $thread2 $thread3) |
| 14 |
(func (;6;) (type $func) |
| 15 |
ref.func $thread1 |
| 16 |
cont.new $cont |
| 17 |
call $enqueue |
| 18 |
ref.func $thread2 |
| 19 |
cont.new $cont |
| 20 |
call $enqueue |
| 21 |
ref.func $thread3 |
| 22 |
cont.new $cont |
| 23 |
call $enqueue |
| 24 |
i32.const -1 |
| 25 |
call $log |
| 26 |
call $scheduler |
| 27 |
i32.const -2 |
| 28 |
call $log |
| 29 |
) |
| 30 |
) |