MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / main

Function main

user/src/bin/stackless_coroutine.rs:109–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108#[no_mangle]
109pub fn main() -> i32 {
110 println!("stackless coroutine Begin..");
111 let mut exec = Executor::new();
112 println!(" Create futures");
113 for instance in 1..=3 {
114 exec.push(move |mut task| async move {
115 println!(" Task {}: begin state", instance);
116 task.waiter().await;
117 println!(" Task {}: next state", instance);
118 task.waiter().await;
119 println!(" Task {}: end state", instance);
120 });
121 }
122
123 println!(" Running");
124 exec.run();
125 println!(" Done");
126 println!("stackless coroutine PASSED");
127
128 0
129}

Callers

nothing calls this directly

Calls 3

waiterMethod · 0.80
pushMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected