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

Function program_exit

lab6/src/1/src/kernel/program.cpp:110–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

printfFunction · 0.70
scheduleMethod · 0.45
disableInterruptMethod · 0.45

Tested by

no test coverage detected