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

Method allocatePCB

lab7/src/3/src/kernel/program.cpp:129–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129PCB *ProgramManager::allocatePCB()
130{
131 for (int i = 0; i < MAX_PROGRAM_AMOUNT; ++i)
132 {
133 if (!PCB_SET_STATUS[i])
134 {
135 PCB_SET_STATUS[i] = true;
136 return (PCB *)((int)PCB_SET + PCB_SIZE * i);
137 }
138 }
139
140 return nullptr;
141}
142
143void ProgramManager::releasePCB(PCB *program)
144{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected