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

Function critical_test_enter

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

Source from the content-addressed store, hash-verified

17static GUARD: AtomicUsize = AtomicUsize::new(0);
18
19fn critical_test_enter() {
20 assert_eq!(GUARD.fetch_add(1, Ordering::SeqCst), 0);
21}
22
23fn critical_test_claim() {
24 assert_eq!(GUARD.load(Ordering::SeqCst), 1);

Callers 1

thread_fnFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected