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

Function first

user/src/bin/sync_sem.rs:16–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14const SEM_SYNC: usize = 0;
15
16unsafe fn first() -> ! {
17 sleep(10);
18 println!("First work and wakeup Second");
19 semaphore_up(SEM_SYNC);
20 exit(0)
21}
22
23unsafe fn second() -> ! {
24 println!("Second want to continue,but need to wait first");

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.85
semaphore_upFunction · 0.85
exitFunction · 0.85

Tested by

no test coverage detected