SIM:Add missing mutex unlock; need to used up_hostusleep(), not usleep(), in up_idle

This commit is contained in:
Gregory Nutt
2016-02-11 17:18:28 -06:00
parent e41de0a00e
commit 62e6275fe5
2 changed files with 8 additions and 9 deletions
+4 -9
View File
@@ -48,10 +48,6 @@
#include "up_internal.h" #include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -71,10 +67,6 @@ extern void up_x11update(void);
#endif #endif
#endif #endif
/****************************************************************************
* Private Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -197,9 +189,12 @@ 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();
usleep(25*1000); up_hostusleep(25*1000);
#endif
#endif #endif
} }
+4
View File
@@ -96,6 +96,10 @@ static void *sim_idle_trampoline(void *arg)
return NULL; return NULL;
} }
/* Let up_cpustart() continue */
(void)pthread_mutex_unlock(&cpuinfo->mutex);
/* Give control to the IDLE task */ /* Give control to the IDLE task */
(void)cpuinfo->idletask(0, (char **)0); (void)cpuinfo->idletask(0, (char **)0);