MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / lock

Method lock

lab6/src/2/src/kernel/sync.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void SpinLock::lock()
17{
18 uint32 key = 1;
19
20 do
21 {
22 asm_atomic_exchange(&key, &bolt);
23 //printf("pid: %d\n", programManager.running->pid);
24 } while (key);
25}
26
27void SpinLock::unlock()
28{

Callers 2

a_motherFunction · 0.45
a_naughty_boyFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected