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

Function program_exit

lab7/src/5/src/kernel/program.cpp:112–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void program_exit()
113{
114 PCB *thread = programManager.running;
115 thread->status = ProgramStatus::DEAD;
116
117 if (thread->pid)
118 {
119 programManager.schedule();
120 }
121 else
122 {
123 interruptManager.disableInterrupt();
124 printf("halt\n");
125 asm_halt();
126 }
127}
128
129PCB *ProgramManager::allocatePCB()
130{

Callers

nothing calls this directly

Calls 3

printfFunction · 0.70
scheduleMethod · 0.45
disableInterruptMethod · 0.45

Tested by

no test coverage detected