mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
[MINOR] avoid inlining in task.c
The task management functions used to call __tv_* which is not really optimal given the size of the functions.
This commit is contained in:
parent
0481c20e66
commit
c64e5397f6
12
src/task.c
12
src/task.c
@ -84,7 +84,6 @@ struct task *task_queue(struct task *task)
|
|||||||
*/
|
*/
|
||||||
void wake_expired_tasks(struct timeval *next)
|
void wake_expired_tasks(struct timeval *next)
|
||||||
{
|
{
|
||||||
__label__ out;
|
|
||||||
int slen;
|
int slen;
|
||||||
struct task *task;
|
struct task *task;
|
||||||
void *data;
|
void *data;
|
||||||
@ -96,9 +95,9 @@ void wake_expired_tasks(struct timeval *next)
|
|||||||
|
|
||||||
if (likely(timer_wq.data != NULL)) {
|
if (likely(timer_wq.data != NULL)) {
|
||||||
task = LIST_ELEM(timer_wq.data, struct task *, qlist);
|
task = LIST_ELEM(timer_wq.data, struct task *, qlist);
|
||||||
if (likely(__tv_isge(&task->expire, &now) > 0)) {
|
if (likely(tv_isgt(&task->expire, &now))) {
|
||||||
__tv_remain(&now, &task->expire, next);
|
tv_remain(&now, &task->expire, next);
|
||||||
goto out;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +107,8 @@ void wake_expired_tasks(struct timeval *next)
|
|||||||
tree64_foreach(&timer_wq, data, stack, slen) {
|
tree64_foreach(&timer_wq, data, stack, slen) {
|
||||||
task = LIST_ELEM(data, struct task *, qlist);
|
task = LIST_ELEM(data, struct task *, qlist);
|
||||||
|
|
||||||
if (__tv_isgt(&task->expire, &now)) {
|
if (tv_isgt(&task->expire, &now)) {
|
||||||
__tv_remain2(&now, &task->expire, next);
|
tv_remain(&now, &task->expire, next);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +124,6 @@ void wake_expired_tasks(struct timeval *next)
|
|||||||
task->state = TASK_RUNNING;
|
task->state = TASK_RUNNING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user