File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ coroutine_wake_up :: (id: int) #foreign coroutine;
7
7
coroutine_init :: () #foreign coroutine ;
8
8
coroutine_finish :: () #foreign coroutine ;
9
9
coroutine_yield :: () #foreign coroutine ;
10
- coroutine_go :: (f : (* void ) #c_call , arg : * void ) #foreign coroutine ;
10
+ coroutine_go :: (f : (* void ) #c_call , arg : * void = null ) #foreign coroutine ;
11
11
coroutine_id :: () -> int #foreign coroutine ;
12
12
coroutine_alive :: () -> int #foreign coroutine ;
13
13
@@ -24,6 +24,11 @@ counter :: (arg: *void) #c_call {
24
24
main :: () {
25
25
coroutine_init ();
26
26
defer coroutine_finish ();
27
+ coroutine_go ((arg : * void ) #c_call {
28
+ push_context {
29
+ print (" [% ] Hello from Jai Lambda\n " , coroutine_id ());
30
+ }
31
+ });
27
32
coroutine_go (counter , cast (* void ) 5 );
28
33
coroutine_go (counter , cast (* void ) 10 );
29
34
while coroutine_alive () > 1 {
You can’t perform that action at this time.
0 commit comments