| 129 | extern struct Block emptyBlock; |
| 130 | |
| 131 | void 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 | |
| 149 | void runTimers() { |
| 150 | U32 millies = KSystem::getMilliesSinceStart(); |
no test coverage detected