[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] persistent 0 second timer events



I often use 0 second timer events to put something onto the event queue in a friendly manner (ie. allow other items that were already there to be processed, and get to my 'new work' when it's fair to).

Trying to set up a persistent 0 second timer doesn't work, though:

event_set(evq, -1, EV_PERSIST, my_callback, udata);
if (udata->evbase) {
event_base_set(udata->evbase, evq);
}
udata->tv.tv_sec = 0;
udata->tv.tv_usec = 0;
evtimer_add(evq, &(udata->tv));

If tv.tv_sec or tv.tv_usec is any positive value, everything works as I expect, I get a persistent timer event.  However, if they are both 0, the timer event fires once, but never again.

Is this a known issue?


- jsd