TODO: assert on fd watcher linked list pointing to itself
TODO: faq, process a thing in each iteration
TODO: abuse idle watchers for their side effect
+TODO: abuse check watchers for their side effect
- add throw() to all libev functions that cannot throw exceptions, for
further code size decrease when compiling for C++.
- add throw () to callbacks that must not throw exceptions (allocator,
static void
idle_cb (struct ev_loop *loop, ev_idle *w, int revents)
{
+ // stop the watcher
+ ev_idle_stop (loop, w);
+
+ // now we can free it
free (w);
+
// now do something you wanted to do when the program has
// no longer anything immediate to do.
}