MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / runThreadSlice

Function runThreadSlice

source/kernel/kscheduler.cpp:131–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129extern struct Block emptyBlock;
130
131void runThreadSlice(KThread* thread) {
132 CPU* cpu;
133
134 cpu = thread->cpu;
135 cpu->blockInstructionCount = 0;
136 cpu->yield = false;
137 cpu->nextOp = cpu->getNextOp(); // another thread that just ran could have modified this
138 try {
139 do {
140 cpu->run();
141 } while ((int)cpu->blockInstructionCount < contextTimeRemaining && !cpu->yield);
142 } catch (...) {
143 cpu->nextOp = nullptr;
144 }
145
146 cpu->instructionCount+=cpu->blockInstructionCount;
147}
148
149void runTimers() {
150 U32 millies = KSystem::getMilliesSinceStart();

Callers 2

runSliceFunction · 0.85
waitForProcessToFinishFunction · 0.85

Calls 2

getNextOpMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected