root/daemons/controld/controld_timers.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2019 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef CONTROLD_TIMERS__H
  11 #  define CONTROLD_TIMERS__H
  12 
  13 #  include <stdbool.h>              // bool
  14 #  include <glib.h>                 // gboolean, gpointer, guint
  15 #  include <controld_fsa.h>         // crmd_fsa_input
  16 
  17 typedef struct fsa_timer_s {
  18     guint source_id;                        // Timer source ID
  19     guint period_ms;                        // Timer period
  20     enum crmd_fsa_input fsa_input;          // Input to register if timer pops
  21     gboolean (*callback) (gpointer data);   // What do if timer pops
  22     bool log_error;                         // Timer popping indicates error
  23     int counter;                            // For detecting loops
  24 } fsa_timer_t;
  25 
  26 extern fsa_timer_t *election_trigger;
  27 extern fsa_timer_t *shutdown_escalation_timer;
  28 extern fsa_timer_t *transition_timer;
  29 extern fsa_timer_t *integration_timer;
  30 extern fsa_timer_t *finalization_timer;
  31 extern fsa_timer_t *wait_timer;
  32 extern fsa_timer_t *recheck_timer;
  33 
  34 extern guint recheck_interval_ms;
  35 extern time_t recheck_by;
  36 
  37 bool controld_init_fsa_timers(void);
  38 void controld_free_fsa_timers(void);
  39 gboolean controld_stop_timer(fsa_timer_t *timer);
  40 void controld_start_timer(fsa_timer_t *timer);
  41 void controld_start_recheck_timer(void);
  42 gboolean is_timer_started(fsa_timer_t *timer);
  43 
  44 const char *get_timer_desc(fsa_timer_t * timer);
  45 
  46 #endif

/* [previous][next][first][last][top][bottom][index][help] */