MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / std_rwlock

Function std_rwlock

toys/intra/src/main.rs:12–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12fn std_rwlock() -> i32 {
13 let rw1 = sync::RwLock::new(1);
14 let mut a = 0;
15 match *rw1.read().unwrap() {
16 1 => { *rw1.write().unwrap() += 1; },
17 _ => { a = *rw1.read().unwrap(); },
18 };
19 a
20}
21
22fn parking_lot_mutex() {
23 let mu1 = parking_lot::Mutex::new(1);

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected