mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
scheduler: fix issue with threads being lost
This commit is contained in:
@@ -546,7 +546,11 @@ static void yield(context_t *context, void *) {
|
||||
|
||||
if (sleeping && (thread->shouldexit || gotsignal) && (thread->flags & SCHED_THREAD_FLAGS_INTERRUPTIBLE)) {
|
||||
sleeping = false;
|
||||
|
||||
if (next)
|
||||
runqueueinsert(next);
|
||||
next = NULL;
|
||||
|
||||
thread->flags &= ~(SCHED_THREAD_FLAGS_SLEEP | SCHED_THREAD_FLAGS_INTERRUPTIBLE);
|
||||
thread->wakeupreason = SCHED_WAKEUP_REASON_INTERRUPTED;
|
||||
spinlock_release(&thread->sleeplock);
|
||||
|
||||
Reference in New Issue
Block a user