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

Function critical_section

user/src/bin/adder.rs:16–23  ·  view source on GitHub ↗
(t: &mut usize)

Source from the content-addressed store, hash-verified

14static mut PER_THREAD: usize = 0;
15
16unsafe fn critical_section(t: &mut usize) {
17 let a = &mut A as *mut usize;
18 let cur = a.read_volatile();
19 for _ in 0..500 {
20 *t = (*t) * (*t) % 10007;
21 }
22 a.write_volatile(cur + 1);
23}
24
25unsafe fn f() -> ! {
26 let mut t = 2usize;

Callers 1

fFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected