disable timer thread for MiniGUI-Threads

This commit is contained in:
Vincent Wei
2019-07-14 17:08:36 +08:00
parent 3a37407982
commit ce29edbca6
2 changed files with 13 additions and 5 deletions
+8
View File
@@ -182,6 +182,14 @@ static void* EventLoop (void* data)
while (__mg_quiting_stage > _MG_QUITING_STAGE_EVENT) {
EXTRA_INPUT_EVENT extra;
/* VM: Since 4.0.0, update timer counter in event loop */
#ifndef __USE_TIMER_THREAD
if (__mg_quiting_stage > _MG_QUITING_STAGE_TIMER) {
extern void __mg_timer_action (void *data);
__mg_timer_action (NULL);
}
#endif
extra.params_mask = 0;
event = IAL_WaitEvent (0, NULL, NULL, NULL, &__mg_event_timeout, &extra);
if (event < 0)
+5 -5
View File
@@ -79,7 +79,7 @@ static pthread_mutex_t timerLock;
#endif
/* timer action for minigui timers */
static void __mg_timer_action (void *data)
void __mg_timer_action (void *data)
{
#if defined(_MGRM_PROCESSES)
SHAREDRES_TIMER_COUNTER = __mg_os_get_time_ms()/10;
@@ -101,7 +101,7 @@ static void __mg_timer_action (void *data)
static OS_TIMER_ID __mg_os_timer = 0;
#else /* __AOS__ */
#elif defined(__USE_TIMER_THREAD) /* __AOS__ */
static void* TimerEntry (void* data)
{
sem_post ((sem_t*)data);
@@ -114,7 +114,7 @@ static void* TimerEntry (void* data)
/* printf("quit from TimerEntry()\n"); */
return NULL;
}
#endif /* !__AOS__ */
#endif /* __USE_TIMER_THREAD */
int __mg_timer_init (void)
{
@@ -127,7 +127,7 @@ int __mg_timer_init (void)
__mg_os_timer = tp_os_timer_create ("mgtimer", __mg_timer_action,
NULL, AOS_TIMER_TICKT,
OS_AUTO_ACTIVATE | OS_AUTO_LOAD);
#else /* NOT __AOS__ */
#elif defined(__USE_TIMER_THREAD) /* __AOS__ */
{
sem_t wait;
sem_init (&wait, 0, 0);
@@ -135,7 +135,7 @@ int __mg_timer_init (void)
sem_wait (&wait);
sem_destroy (&wait);
}
#endif /* __AOS__ */
#endif /* __USE_TIMER_THREAD */
return 0;
}