judge changed

pull/2/head
yuqing 2014-10-09 18:09:12 +08:00
parent 5e6233ab69
commit 8ad9d6961b
2 changed files with 11 additions and 18 deletions

View File

@ -1,4 +1,4 @@
Version 1.08 2014-10-08
Version 1.08 2014-10-09
* sched_thread.c: calculate next_call_time correctly
Version 1.07 2014-09-16

View File

@ -269,7 +269,6 @@ static void *sched_thread_entrance(void *args)
ScheduleEntry *pUntil;
int exec_count;
int i;
int sleep_time;
pContext = (ScheduleContext *)args;
if (sched_init_entries(&(pContext->scheduleArray)) != 0)
@ -291,13 +290,8 @@ static void *sched_thread_entrance(void *args)
}
g_current_time = time(NULL);
sleep_time = pContext->head->next_call_time - g_current_time;
/*
//fprintf(stderr, "count=%d, sleep_time=%d\n", \
pContext->scheduleArray.count, sleep_time);
*/
while (sleep_time > 0 && *(pContext->pcontinue_flag))
while (pContext->head->next_call_time > g_current_time &&
*(pContext->pcontinue_flag))
{
sleep(1);
g_current_time = time(NULL);
@ -305,7 +299,6 @@ static void *sched_thread_entrance(void *args)
{
break;
}
sleep_time--;
}
if (!(*(pContext->pcontinue_flag)))