Merge 'task1/priority-donation' into 'master' #14

Merged
sb3923 merged 66 commits from task1/priority-donation into master 2024-10-23 16:15:45 +00:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit 8b3f9e353f - Show all commits

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;
} }