restore timer thread

This commit is contained in:
Vincent Wei
2019-07-14 17:17:40 +08:00
parent ce29edbca6
commit e256fb2a0a
2 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -182,8 +182,9 @@ static void* EventLoop (void* data)
while (__mg_quiting_stage > _MG_QUITING_STAGE_EVENT) {
EXTRA_INPUT_EVENT extra;
#if 0
ndef __USE_TIMER_THREAD
/* 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);
+5 -5
View File
@@ -79,7 +79,7 @@ static pthread_mutex_t timerLock;
#endif
/* timer action for minigui timers */
void __mg_timer_action (void *data)
static void __mg_timer_action (void *data)
{
#if defined(_MGRM_PROCESSES)
SHAREDRES_TIMER_COUNTER = __mg_os_get_time_ms()/10;
@@ -101,7 +101,7 @@ void __mg_timer_action (void *data)
static OS_TIMER_ID __mg_os_timer = 0;
#elif defined(__USE_TIMER_THREAD) /* __AOS__ */
#else /* __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 /* __USE_TIMER_THREAD */
#endif /* !__AOS__ */
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);
#elif defined(__USE_TIMER_THREAD) /* __AOS__ */
#else /* __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 /* __USE_TIMER_THREAD */
#endif /* !__AOS__ */
return 0;
}