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

Function main

user/src/bin/threads_arg.rs:25–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24#[no_mangle]
25pub fn main() -> i32 {
26 let mut v = Vec::new();
27 let args = [
28 Argument { ch: 'a', rc: 1 },
29 Argument { ch: 'b', rc: 2 },
30 Argument { ch: 'c', rc: 3 },
31 ];
32 for arg in args.iter() {
33 v.push(thread_create(
34 thread_print as usize,
35 arg as *const _ as usize,
36 ));
37 }
38 for tid in v.iter() {
39 let exit_code = waittid(*tid as usize);
40 println!("thread#{} exited with code {}", tid, exit_code);
41 }
42 println!("main thread exited.");
43 0
44}

Callers

nothing calls this directly

Calls 3

thread_createFunction · 0.85
waittidFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected