X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftimer%2F_info;h=420aba1145ad46372d6a34172c5a837d32800a2b;hb=3750ffaa89f0d771990152e6c0894681dffc4850;hp=580b115c563d289d6a1195af61cd5e53ca471124;hpb=daf9ee7d8e2b683ff05283beb1843611ad8c9e8a;p=ccan diff --git a/ccan/timer/_info b/ccan/timer/_info index 580b115c..420aba11 100644 --- a/ccan/timer/_info +++ b/ccan/timer/_info @@ -1,5 +1,6 @@ -#include #include "config.h" +#include +#include /** * timer - efficient implementation of rarely-expiring timers. @@ -27,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()); @@ -47,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); * }