mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
SIM:Add missing mutex unlock; need to used up_hostusleep(), not usleep(), in up_idle
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user