Avoid 100% CPU utlization in thread_yield

This commit is contained in:
Andrea Mazzoleni 2026-07-06 17:32:21 +02:00
parent dcb7327f15
commit 4bbfdc43d9

View file

@ -2972,9 +2972,10 @@ void thread_join(thread_id_t thread, void** retval)
void thread_yield(void)
{
#ifdef __MINGW32__
Sleep(0);
Sleep(1); /* avoid 100% cpu utilization */
#else
sched_yield();
usleep(1000); /* avoid 100% cpu utilization */
#endif
}
#endif