This commit is contained in:
wheremyfoodat 2023-04-24 23:25:56 +03:00
parent 1cf8af98c2
commit 0eeff3535f

View file

@ -102,7 +102,7 @@ void Kernel::switchToNextThread() {
void Kernel::rescheduleThreads() {
std::optional<int> newThreadIndex = getNextThread();
if (newThreadIndex.has_value()) {
if (newThreadIndex.has_value() && newThreadIndex.value() != currentThreadIndex) {
threads[currentThreadIndex].status = ThreadStatus::Ready;
switchThread(newThreadIndex.value());
}