timer: make timer_del() idempotent, add timer_init().
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 29 Oct 2014 05:40:21 +0000 (16:10 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 30 Oct 2014 22:52:11 +0000 (09:22 +1030)
commita9d42b8d3bf2b37f47caa428e869fceb4bb33082
tree038d2feb0b29f2f6c49ae898419a1a6b1a664a4d
parentfe6bc8c530795a6c718f7e8fd1a6643d9f3024a1
timer: make timer_del() idempotent, add timer_init().

This catches duplicate timer_add() calls, as well as meaning we don't
need to track if the timer is active before calling timer_del().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/timer/test/run-add.c
ccan/timer/test/run-expiry.c
ccan/timer/test/run-ff.c
ccan/timer/test/run.c
ccan/timer/timer.c
ccan/timer/timer.h