| 93 | } |
| 94 | |
| 95 | void scheduleThread(KThread* thread) { |
| 96 | #ifdef _DEBUG |
| 97 | if (thread->waitingCond) { |
| 98 | kpanic("can't schedule a thread that is waiting"); |
| 99 | } |
| 100 | if (thread->condTimer.active) { |
| 101 | kpanic("can't schedule a thread that is waiting on a timer"); |
| 102 | } |
| 103 | #endif |
| 104 | thread->cpu->yield = false; |
| 105 | scheduledThreads.addToFront(&thread->scheduledThreadNode); |
| 106 | } |
| 107 | |
| 108 | void unscheduleThread(KThread* thread) { |
| 109 | thread->scheduledThreadNode.remove(); |