On Fri, Aug 1, 2014 at 3:39 AM, Saúl Ibarra Corretgé <[email protected]> wrote:
> Well, your timer was called when uv_run started its process, because due
> timers are the first thing to be calculated. If you schedule more timers
> in other callbacks, they will run on the next iteration.
>
> If you think you've found an inconsistency, can you provide a test case?
Sure. I posted this before, but here it is again (with UV_RUN_NOWAIT
instead, just for grins). Expected behavior: UV_RUN_NOWAIT should
return instead of busylooping until the end of time. See attached.
--
You received this message because you are subscribed to the Google Groups
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.
#include <uv.h>
uv_timer_t timer;
void run(uv_timer_t* _unused, int status) {
uv_timer_stop(&timer);
uv_timer_start(&timer, run, 0, 0);
}
void main() {
uv_loop_t* loop = uv_default_loop();
uv_timer_init(loop, &timer);
uv_timer_start(&timer, run, 0, 0);
uv_run(loop, UV_RUN_NOWAIT);
}