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

Function second

user/src/bin/test_condvar.rs:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31unsafe fn second() -> ! {
32 println!("Second want to continue,but need to wait A=1");
33 mutex_lock(MUTEX_ID);
34 while A == 0 {
35 println!("Second: A is {}", A);
36 condvar_wait(CONDVAR_ID, MUTEX_ID);
37 }
38 mutex_unlock(MUTEX_ID);
39 println!("A is {}, Second can work now", A);
40 exit(0)
41}
42
43#[no_mangle]
44pub fn main() -> i32 {

Callers

nothing calls this directly

Calls 4

mutex_lockFunction · 0.85
condvar_waitFunction · 0.85
mutex_unlockFunction · 0.85
exitFunction · 0.85

Tested by

no test coverage detected