| 1 |
(module $example |
| 2 |
(type (;0;) (func)) |
| 3 |
(type (;1;) (func (param i32))) |
| 4 |
(import "lwt" "yield" (tag $yield (;0;) (type 0))) |
| 5 |
(import "spectest" "print_i32" (func $log (;0;) (type 1))) |
| 6 |
(export "thread1" (func $thread1)) |
| 7 |
(export "thread2" (func $thread2)) |
| 8 |
(export "thread3" (func $thread3)) |
| 9 |
(func $thread1 (;1;) (type 0) |
| 10 |
i32.const 10 |
| 11 |
call $log |
| 12 |
suspend $yield |
| 13 |
i32.const 11 |
| 14 |
call $log |
| 15 |
suspend $yield |
| 16 |
i32.const 12 |
| 17 |
call $log |
| 18 |
) |
| 19 |
(func $thread2 (;2;) (type 0) |
| 20 |
i32.const 20 |
| 21 |
call $log |
| 22 |
suspend $yield |
| 23 |
i32.const 21 |
| 24 |
call $log |
| 25 |
suspend $yield |
| 26 |
i32.const 22 |
| 27 |
call $log |
| 28 |
) |
| 29 |
(func $thread3 (;3;) (type 0) |
| 30 |
i32.const 30 |
| 31 |
call $log |
| 32 |
suspend $yield |
| 33 |
i32.const 31 |
| 34 |
call $log |
| 35 |
suspend $yield |
| 36 |
i32.const 32 |
| 37 |
call $log |
| 38 |
) |
| 39 |
) |