diff --git a/arch/sim/src/up_idle.c b/arch/sim/src/up_idle.c index d3009028f95..93d850dfe76 100644 --- a/arch/sim/src/up_idle.c +++ b/arch/sim/src/up_idle.c @@ -48,10 +48,6 @@ #include "up_internal.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Private Data ****************************************************************************/ @@ -71,10 +67,6 @@ extern void up_x11update(void); #endif #endif -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -197,9 +189,12 @@ void up_idle(void) lock = SP_UNLOCKED; +#if !defined(CONFIG_SIM_WALLTIME) && !defined(CONFIG_SIM_X11FB) /* Give other pthreads/CPUs a shot */ //pthread_yield(); - usleep(25*1000); + up_hostusleep(25*1000); + +#endif #endif } diff --git a/arch/sim/src/up_simsmp.c b/arch/sim/src/up_simsmp.c index da9ccd6e46a..c54144678d5 100644 --- a/arch/sim/src/up_simsmp.c +++ b/arch/sim/src/up_simsmp.c @@ -96,6 +96,10 @@ static void *sim_idle_trampoline(void *arg) return NULL; } + /* Let up_cpustart() continue */ + + (void)pthread_mutex_unlock(&cpuinfo->mutex); + /* Give control to the IDLE task */ (void)cpuinfo->idletask(0, (char **)0);