X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftimer%2F_info;h=420aba1145ad46372d6a34172c5a837d32800a2b;hb=61c38f61b8a40dbd8fe48b7510e00cfcc5379378;hp=4c58d9e5f5bee7da8dce493b53946f84931b8975;hpb=291237b4fed863be74051274ac5ad9920cb33cc3;p=ccan diff --git a/ccan/timer/_info b/ccan/timer/_info index 4c58d9e5..420aba11 100644 --- a/ccan/timer/_info +++ b/ccan/timer/_info @@ -28,7 +28,7 @@ * { * struct timers timers; * struct list_head strings; - * struct list_head expired; + * struct timer *t; * struct timed_string *s; * * timers_init(&timers, time_now()); @@ -48,9 +48,8 @@ * struct timeabs now = time_now(); * list_for_each(&strings, s, node) * printf("%s", s->string); - * timers_expire(&timers, now, &expired); - * while ((s = list_pop(&expired, struct timed_string, - * timer.list)) != NULL) { + * while ((t = timers_expire(&timers, now)) != NULL) { + * s = container_of(t, struct timed_string, timer); * list_del_from(&strings, &s->node); * free(s); * }