SIM: In SMP simulation, use pthread_yield(), not up_hostusleep() to reliquish the CPU.

This commit is contained in:
Gregory Nutt
2016-02-12 08:13:44 -06:00
parent 62e6275fe5
commit d22aa4b588
+5 -6
View File
@@ -99,8 +99,11 @@ void up_idle(void)
if (up_testset(&lock) != SP_UNLOCKED) if (up_testset(&lock) != SP_UNLOCKED)
{ {
/* We didn't get it... just return and try again later */ /* We didn't get it... Give other pthreads/CPUs a shot and try again
* later.
*/
pthread_yield();
return; return;
} }
#endif #endif
@@ -189,12 +192,8 @@ void up_idle(void)
lock = SP_UNLOCKED; lock = SP_UNLOCKED;
#if !defined(CONFIG_SIM_WALLTIME) && !defined(CONFIG_SIM_X11FB)
/* Give other pthreads/CPUs a shot */ /* Give other pthreads/CPUs a shot */
//pthread_yield(); pthread_yield();
up_hostusleep(25*1000);
#endif
#endif #endif
} }