Update thread_yield to add thread back in sorted order of priority

This commit is contained in:
sBubshait
2024-10-16 08:18:51 +01:00
parent fda79173c0
commit 62c8818c05

View File

@@ -336,8 +336,11 @@ thread_yield (void)
ASSERT (!intr_context ());
old_level = intr_disable ();
/* Insert the thread back into the ready list in priority order. */
if (cur != idle_thread)
list_push_back (&ready_list, &cur->elem);
list_insert_ordered(&ready_list, &cur->elem, priority_more, NULL);
cur->status = THREAD_READY;
schedule ();
intr_set_level (old_level);