sched_thread.c: calculate next_call_time correctly

pull/2/head
yuqing 2014-10-08 16:58:25 +08:00
parent 07d9cfa9b8
commit 5e6233ab69
3 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,5 @@
Version 1.08 2014-10-08
* sched_thread.c: calculate next_call_time correctly
Version 1.07 2014-09-16
* increment alloc task buffer

View File

@ -1,5 +1,5 @@
Name: libfastcommon
Version: 1.0.7
Version: 1.0.8
Release: 1%{?dist}
Summary: c common functions library extracted from my open source projects FastDFS
License: GPL

View File

@ -320,8 +320,10 @@ static void *sched_thread_entrance(void *args)
{
//fprintf(stderr, "exec task id=%d\n", pCurrent->id);
pCurrent->task_func(pCurrent->func_args);
pCurrent->next_call_time = g_current_time + \
pCurrent->interval;
do
{
pCurrent->next_call_time += pCurrent->interval;
} while (pCurrent->next_call_time <= g_current_time);
pCurrent = pCurrent->next;
exec_count++;
}