Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/YatSenOS/YatSenOS-Tutorial-Volume-1
/ lock
Method
lock
lab7/src/2/src/kernel/sync.cpp:17–26 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
15
}
16
17
void SpinLock::lock()
18
{
19
uint32 key = 1;
20
21
do
22
{
23
asm_atomic_exchange(&key, &bolt);
24
//printf(
"pid: %d\n"
, programManager.running->pid);
25
} while (key);
26
}
27
28
void SpinLock::unlock()
29
{
Callers
2
P
Method · 0.45
V
Method · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected