On Mon, Jul 13, 2009 at 02:29:21PM +0200, q6Yr7e0o nIJDVMjC wrote: > Hi, > > > how is it possible to schedule a callback in the next eventloop > iteration? Of course i could add a timer event with timeout 0 but this > seems like a lot of overhead. I just want a function to be called in > the next event iteration (i can't call it directly in another libevent > callback because the first callback is called inside the > buffer_chain_free method and the method itself wants to write to the > buffer).
The easiest thing to do here is to use the event_active() call to make the event active now. But it doesn't do quite what you asked for: the callback will be run later in the current iteration of the loop, not in the next iteration. If it needs to be in the next iteration, I can't offhand think of a better way than adding an event with a 0 callback. yrs, -- Nick _______________________________________________ Libevent-users mailing list Libeventemail@example.com http://monkeymail.org/mailman/listinfo/libevent-users