summaryrefslogtreecommitdiff
path: root/lib/wheel.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2017-05-10 13:51:47 -0400
committerGitHub <noreply@github.com>2017-05-10 13:51:47 -0400
commit00a1578051ceeb26b0b9c2c3344cac1f202e047d (patch)
tree248b55b1ab56e39025d9902c53564286558eda60 /lib/wheel.c
parent0896b755080b300116d493444bfc05e2ef7ca9f6 (diff)
parentc94671b82f790492ceee226f98a65ad7e7e09967 (diff)
Merge pull request #408 from qlyoung/remove-thread-macros
*: remove THREAD_ON macros, add nullity check
Diffstat (limited to 'lib/wheel.c')
-rw-r--r--lib/wheel.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/wheel.c b/lib/wheel.c
index fe53dea299..9bcb1b8743 100644
--- a/lib/wheel.c
+++ b/lib/wheel.c
@@ -60,9 +60,8 @@ wheel_timer_thread (struct thread *t)
slots_to_skip++;
wheel->slots_to_skip = slots_to_skip;
- THREAD_TIMER_MSEC_ON (wheel->master, wheel->timer,
- wheel_timer_thread, wheel,
- wheel->nexttime * slots_to_skip);
+ thread_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
+ wheel->nexttime * slots_to_skip, &wheel->timer);
return 0;
}
@@ -91,9 +90,8 @@ wheel_init (struct thread_master *master, int period, size_t slots,
for (i = 0; i < slots; i++)
wheel->wheel_slot_lists[i] = list_new ();
- THREAD_TIMER_MSEC_ON (wheel->master, wheel->timer,
- wheel_timer_thread, wheel,
- wheel->nexttime);
+ thread_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
+ wheel->nexttime, &wheel->timer);
return wheel;
}
@@ -124,9 +122,8 @@ int
wheel_start (struct timer_wheel *wheel)
{
if (!wheel->timer)
- THREAD_TIMER_MSEC_ON (wheel->master, wheel->timer,
- wheel_timer_thread, wheel,
- wheel->nexttime);
+ thread_add_timer_msec(wheel->master, wheel_timer_thread, wheel,
+ wheel->nexttime, &wheel->timer);
return 0;
}