tor  master
Functions
periodic.c File Reference

Generic backend for handling periodic events. More...

#include "or.h"
#include "compat_libevent.h"
#include "config.h"
#include "main.h"
#include "periodic.h"
Include dependency graph for periodic.c:

Functions

void periodic_event_reschedule (periodic_event_item_t *event)
 
void periodic_event_setup (periodic_event_item_t *event)
 
void periodic_event_launch (periodic_event_item_t *event)
 
void periodic_event_destroy (periodic_event_item_t *event)
 
void periodic_event_enable (periodic_event_item_t *event)
 
void periodic_event_disable (periodic_event_item_t *event)
 

Detailed Description

Generic backend for handling periodic events.

The events in this module are used by main.c to track items that need to fire once every N seconds, possibly picking a new interval each time that they fire. See periodic_events[] in main.c for examples.

Function Documentation

◆ periodic_event_destroy()

void periodic_event_destroy ( periodic_event_item_t event)

Release all storage associated with event

◆ periodic_event_disable()

void periodic_event_disable ( periodic_event_item_t event)

Disable the given event which means the event is destroyed and then the event's enabled flag is unset. This can be called for an event that is already disabled.

Here is the call graph for this function:

◆ periodic_event_enable()

void periodic_event_enable ( periodic_event_item_t event)

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 already enabled.

Here is the call graph for this function:

◆ periodic_event_launch()

void periodic_event_launch ( periodic_event_item_t event)

Handles initial dispatch for periodic events. It should happen 1 second after the events are created to mimic behaviour before #3199's refactor

Here is the caller graph for this function:

◆ periodic_event_reschedule()

void periodic_event_reschedule ( periodic_event_item_t event)

Schedules event to run as soon as possible from now.

Here is the caller graph for this function:

◆ periodic_event_setup()

void periodic_event_setup ( periodic_event_item_t event)

Initializes the libevent backend for a periodic event.

Here is the caller graph for this function: