[MEDIUM] many cleanups in the time functions
Now, functions whose name begins with '__tv_' are inlined. Also,
'tv_ms' is used as a prefix for functions using milliseconds.
diff --git a/src/task.c b/src/task.c
index a2ca0404..2fd6efa 100644
--- a/src/task.c
+++ b/src/task.c
@@ -96,8 +96,8 @@
if (likely(timer_wq.data != NULL)) {
task = LIST_ELEM(timer_wq.data, struct task *, qlist);
- if (likely(tv_cmp_ge(&task->expire, &now) > 0))
- return tv_remain(&now, &task->expire);
+ if (likely(__tv_isge(&task->expire, &now) > 0))
+ return tv_ms_remain(&now, &task->expire);
}
/* OK we lose. Let's scan the tree then. */
@@ -106,8 +106,8 @@
tree64_foreach(&timer_wq, data, stack, slen) {
task = LIST_ELEM(data, struct task *, qlist);
- if (!tv_isbefore(&task->expire, &now)) {
- next_time = tv_remain(&now, &task->expire);
+ if (__tv_isgt(&task->expire, &now)) {
+ next_time = tv_ms_remain(&now, &task->expire);
break;
}