Index: src/event.cc =================================================================== RCS file: /cvsroot/squid/squid3/src/event.cc,v retrieving revision 1.5.12.2 diff -u -r1.5.12.2 event.cc --- src/event.cc 16 Apr 2007 19:47:42 -0000 1.5.12.2 +++ src/event.cc 26 Jul 2007 15:28:25 -0000 @@ -305,8 +305,9 @@ void EventScheduler::schedule(const char *name, EVH * func, void *arg, double when, int weight, bool cbdata) { - - struct ev_entry *event = new ev_entry(name, func, arg, current_dtime + when, weight, cbdata); + // Treat when=0 events specially: many are async calls that preserve order + const double timestamp = when > 0.0 ? current_dtime + when : 0; + struct ev_entry *event = new ev_entry(name, func, arg, timestamp, weight, cbdata); struct ev_entry **E; debugs(41, 7, HERE << "schedule: Adding '" << name << "', in " << when << " seconds");