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

Function critical_section

user/src/bin/adder_mutex_blocking.rs:17–24  ·  view source on GitHub ↗
(t: &mut usize)

Source from the content-addressed store, hash-verified

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

Callers 1

fFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected