From 4bbfdc43d9af84a2ebc9845ca029da5e8de1ee1b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 6 Jul 2026 17:32:21 +0200 Subject: [PATCH] Avoid 100% CPU utlization in thread_yield --- cmdline/support.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmdline/support.c b/cmdline/support.c index e8f34fdc..76b11978 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -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