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

Function program_exit

lab8/src/4/src/kernel/program.cpp:135–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

printfFunction · 0.70
scheduleMethod · 0.45
disableInterruptMethod · 0.45

Tested by

no test coverage detected