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

Method V

lab6/src/3/src/kernel/sync.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void Semaphore::V()
69{
70 semLock.lock();
71 ++counter;
72 if (waiting.size())
73 {
74 PCB *program = ListItem2PCB(waiting.front(), tagInGeneralList);
75 waiting.pop_front();
76 semLock.unlock();
77 programManager.MESA_WakeUp(program);
78 }
79 else
80 {
81 semLock.unlock();
82 }
83}

Callers 2

a_motherFunction · 0.45
a_naughty_boyFunction · 0.45

Calls 6

lockMethod · 0.45
sizeMethod · 0.45
frontMethod · 0.45
pop_frontMethod · 0.45
unlockMethod · 0.45
MESA_WakeUpMethod · 0.45

Tested by

no test coverage detected