aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-16 19:00:53 -0700
committerChristian Cunningham <cc@localhost>2022-03-16 19:00:53 -0700
commit068ce025957171feee2971723e955650236ef1f1 (patch)
tree4f0ffbcae40cc170a3cbbf327b342f476cc7392f
parent4d9e61b01339866bb00cefb59e13826a05a6be0e (diff)
Add to original priority level
-rw-r--r--src/sys/schedule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index 75e7d91..c7ed212 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -408,6 +408,8 @@ void sched_mutex_resurrect(void* m)
// Restore the original priority level
if (op != 0xFF) {
struct ThreadEntry* tentry = pop_from_queue(THREAD_READY, p);
- push_to_queue(tentry->thread, THREAD_READY, p);
+ tentry->thread->priority = op;
+ tentry->thread->old_priority = 0xFF;
+ push_to_queue(tentry->thread, THREAD_READY, op);
}
}