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

Function program_exit

lab8/src/3/src/kernel/program.cpp:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

printfFunction · 0.70
scheduleMethod · 0.45
disableInterruptMethod · 0.45

Tested by

no test coverage detected