mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
dfd808cbad
Fixes an issue reported on libevent-users in the thread "a dead looping bug when changing system time backward". Previously, if time jumped forward 1 hour[*] and we had a one-second periodic timer event, that event would get invoked 3600 times. That's almost certainly not what anybody wants. In a future version of Libevent, we should expose the amount of time that the callbac kwould have been invoked somehow. [*] Forward time jumps can happen with nonmonotonic clocks, or with clocks that jump on suspend/resume. It can also happen from Libevent's point of view if the user exits from event_base_loop() and doesn't call it again for a while.