Hello,

I stumbled across libevent and it seems to fit my needs very well.
However, I wonder if this is side-effect free:

second_cb(..) { .. }
first_cb(..) {
  ..
  struct event newev;
  evtimer_set(&newev, second_cb, NULL);
  event_base_set(ev_base, &newev);
  event_add(&newev, &tv);

  event_base_dispatch(ev_base);
}

main() {
  ..
  ev_base = event_init();
  evtimer_set(ev, first_cb, NULL);
  event_add(ev, &tv);

  event_base_dispatch(ev_base);
}

The point of this is creating new events 'on demand', but since I'm calling event_dispatch when being called by event_loop, I wonder if this might lead to recursion issues or similar bad behaviour.

I hope someone can clarify this :)

Thanks,
Christian


_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to