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

Function program_exit

lab8/src/6/src/kernel/program.cpp:138–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void program_exit()
139{
140 PCB *thread = programManager.running;
141 thread->status = ProgramStatus::DEAD;
142
143 if (thread->pid)
144 {
145 programManager.schedule();
146 }
147 else
148 {
149 interruptManager.disableInterrupt();
150 printf("halt\n");
151 asm_halt();
152 }
153}
154
155PCB *ProgramManager::allocatePCB()
156{

Callers

nothing calls this directly

Calls 3

printfFunction · 0.70
scheduleMethod · 0.45
disableInterruptMethod · 0.45

Tested by

no test coverage detected