mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +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"
|
#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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user