I'm building a library and I want to use libevent internally, but I don't want to prevent the users of my library from using libevent for their stuff. The problem is that event_dispatch() would trigger both my events and the user's events. I'd like to use event_base_dispatch(), but unfortunately event_init() sets current_base and there's no way to get an event_base without setting current_base. I realize that event_init() can be called twice, but there's an ordering problem. I don't know if the library will call event_init() first or if the user will. (I know I could mandate that in my interface, but that's kinda gross.)

In short, I can't separate my use of libevent from the user's use. Would it be reasonable for me to do something like create an event_base_init() that just creates an event_base without setting current_base? (I could then make event_init() use the new function internally.)

Niels, would you accept such a patch? Would you accept other patches that go further into trying to allow multiple users of libevent?

Thanks,
  Nate
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to