If the programmer puts an explicit call to sched_yield() in the code that T1 is running, then the scheduler will look to see if there is another runnable thread (T2) of the same priority (there can’t be a higher priority runnable thread).
When a programmer calls `sched_yield()` in T1's code, the scheduler checks if there is another runnable thread with the same priority as T1. If such a thread exists, it will be given the opportunity to run.  If no other runnable thread of the same priority exists, then `sched_yield()` won't be executed.