[Libevent-users] [PATCH] event.c: make internal signal event
count as active
Christopher Layne
clayne at anodized.com
Sat Nov 10 21:49:58 EST 2007
On Sat, Nov 10, 2007 at 06:44:12PM -0800, Christopher Layne wrote:
> 11. here's the funny part: evsignal_process() increments event_count_active - but since our
should be:
evsignal_process() adds the internal event to the active queue as normal.
before we call event_process_active(), event_count_active is 1 at that point (user event).
but since our ...
> internal signal event is actually first on the active queue at this point, when we go to
> process events in the main loop - we actually end up processing our internal signal
> event here. it reads from the pipe, and then re-adds itself back into epoll's watch set.
> but since it's internal, we do not decrement event_count_active - guaranteeing we'll
> get to our user event when we process the active events from the main loop. this is
> the "flip-flop".
-cl
More information about the Libevent-users
mailing list