Update creating thread to yield if the new thread has higher priority

This commit is contained in:
sBubshait
2024-10-16 07:33:24 +01:00
parent 83910f945c
commit 8b3f9e353f

View File

@@ -223,6 +223,10 @@ thread_create (const char *name, int priority,
/* Add to run queue. */ /* Add to run queue. */
thread_unblock (t); thread_unblock (t);
/* Yield if the new thread has a higher priority than the current thread. */
if (priority > thread_get_priority ())
thread_yield ();
return tid; return tid;
} }