mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Avoid 100% CPU utlization in thread_yield
This commit is contained in:
parent
4afa222596
commit
0928ea2b13
1 changed files with 2 additions and 1 deletions
|
|
@ -2929,9 +2929,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue