Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
17
static GUARD: AtomicUsize = AtomicUsize::new(0);
18
19
fn critical_test_enter() {
20
assert_eq!(GUARD.fetch_add(1, Ordering::SeqCst), 0);
21
}
22
23
fn critical_test_claim() {
24
assert_eq!(GUARD.load(Ordering::SeqCst), 1);
Callers
1
thread_fn
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected