jabberd14  1.6.2
Data Structures | Typedefs | Functions | Variables
heartbeat.cc File Reference

functions used to register other functions to be called regularily More...

#include "jabberd.h"

Data Structures

struct  beat_struct

Typedefs

typedef struct beat_structbeat
typedef struct beat_struct _beat

Functions

void * heartbeat (void *arg)
beat _new_beat (void)
void register_beat (int freq, beathandler f, void *arg)
void heartbeat_birth (void)
void heartbeat_death (void)

Variables

beat heartbeat__ring = NULL

Detailed Description

functions used to register other functions to be called regularily


Typedef Documentation

typedef struct beat_struct _beat
typedef struct beat_struct * beat

private heartbeat ring struct


Function Documentation

beat _new_beat ( void  )

allocate memory for a new heartbeat

References beat_struct::p, and pmalloco().

Referenced by heartbeat_birth(), and register_beat().

void* heartbeat ( void *  arg)

this thread continuously checks if a function, that is registered to be called regularly using register_beat() has to be called again

Parameters:
argunused/ignored

References beat_struct::arg, beat_struct::f, beat_struct::freq, beat_struct::last, beat_struct::next, beat_struct::p, pool_free(), beat_struct::prev, and r_UNREG.

Referenced by heartbeat_birth().

void heartbeat_birth ( void  )

start up the heartbeat

References _new_beat(), heartbeat(), heartbeat__ring, beat_struct::next, and beat_struct::prev.

Referenced by main().

void heartbeat_death ( void  )

stop calling hearbeat functions

References heartbeat__ring, beat_struct::next, beat_struct::p, pool_free(), and beat_struct::prev.

Referenced by main().

void register_beat ( int  freq,
beathandler  f,
void *  arg 
)

Variable Documentation

master hook for the ring

Referenced by heartbeat_birth(), heartbeat_death(), and register_beat().