Commit 35c5c9558a70f3108ac0eb5955cad571ea356245

Nick Mathewson 2011-12-07T11:49:52

Bypass event_add when using event_base_once() for a 0-sec timeout Some people use event_base_once(EV_TIMEOUT) to make a callback get called "immediately". But this is pretty roundabout: it uses the timeout heap to immediately put the event onto the active queue, when it could just use event_active. Additionally, it can lead to surprising re-ordering behavior. This patch changes event_base_once so it bypasses event_add() and called event_active() directly on a pure-timeout event with an empty timeout.