diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/mainloop/periodic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/mainloop/periodic.c b/src/core/mainloop/periodic.c index c17c0c56d2..df5317eb34 100644 --- a/src/core/mainloop/periodic.c +++ b/src/core/mainloop/periodic.c @@ -141,8 +141,8 @@ periodic_event_destroy(periodic_event_item_t *event) event->last_action_time = 0; } -/** Enable the given event which means the event is launched and then the - * event's enabled flag is set. This can be called for an event that is +/** Enable the given event by setting its "enabled" flag and scheduling it to + * run immediately in the event loop. This can be called for an event that is * already enabled. */ void periodic_event_enable(periodic_event_item_t *event) @@ -153,7 +153,9 @@ periodic_event_enable(periodic_event_item_t *event) return; } - periodic_event_launch(event); + tor_assert(event->ev); + event->enabled = 1; + mainloop_event_activate(event->ev); } /** Disable the given event which means the event is destroyed and then the |