heartbeat.h

来自「mms client」· C头文件 代码 · 共 40 行

H
40
字号
/* * heartbeat.h - thread for sending heartbeat Msgs to bearerbox */#ifndef HEARTBEAT_H#define HEARTBEAT_H#include "gwlib/gwlib.h"#include "msg.h"#define DEFAULT_HEARTBEAT    30#define ALL_HEARTBEATS       -1/* * Signature for a function that returns the current load value. */typedef long hb_load_func_t(void);/* * Signature for a function that takes the heartbeat msg and does * something with it. */typedef void hb_send_func_t(Msg *hb);/*  * Start a thread that produces Msgs of type heartbeat on the msgs list. * The speed is approximately one per freq seconds. * The function load_func will be called to determine what should be * filled in for the load parameter. * Return the thread number.  Return -1 if the operation failed. */long heartbeat_start(hb_send_func_t *send_func, double freq,                     hb_load_func_t *load_func);/* * Stop the indicated heartbeat thread. */void heartbeat_stop(long hb_thread);#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?