85 static int find_hb(
void *item,
void *pattern)
93 return info->thread == *threadnrp;
104 while (
info->running) {
115 if (difftime(time(NULL), last_hb) <
info->freq / 2)
119 if (NULL !=
info->load_func)
120 msg->heartbeat.load =
info->load_func();
122 last_hb = time(NULL);
141 if (
info->thread >= 0) {
182 if (matching_info == NULL) {
183 warning(0,
"Could not stop heartbeat %ld: not found.", hb_thread);
void info(int err, const char *fmt,...)
gw_assert(wtls_machine->packet_to_send !=NULL)
void gwlist_append(List *list, void *item)
hb_send_func_t * send_func
void gwthread_join(long thread)
long gwlist_len(List *list)
long hb_load_func_t(void)
void hb_send_func_t(Msg *hb)
List * gwlist_extract_matching(List *list, void *pat, gwlist_item_matches_t *cmp)
void heartbeat_stop(long hb_thread)
static int find_hb(void *item, void *pattern)
void * gwlist_extract_first(List *list)
hb_load_func_t * load_func
void warning(int err, const char *fmt,...)
#define gwthread_create(func, arg)
void gwthread_sleep(double seconds)
volatile sig_atomic_t running
#define DEFAULT_HEARTBEAT
long heartbeat_start(hb_send_func_t *send_func, double freq, hb_load_func_t *load_func)
void gwthread_wakeup(long thread)
static void heartbeat_thread(void *arg)
static XMLRPCDocument * msg
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)