Moved the housekeeper heartbeat to a separate header for ease of integration.
This keeps the behavior the same but allows the heartbeat to be used as a crude timer without including everything the housekeeper.h header includes. Moved the protocol level updates on the DCBs last_read value into dcb_read. This keeps the implementation nice and compact.
This commit is contained in:
11
server/include/hk_heartbeat.h
Normal file
11
server/include/hk_heartbeat.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef _HK_HEARTBEAT_H
|
||||
#define _HK_HEARTBEAT_H
|
||||
|
||||
/**
|
||||
* The global housekeeper heartbeat value. This value is increamente
|
||||
* every 100ms and may be used for crude timing etc.
|
||||
*/
|
||||
|
||||
extern unsigned long hkheartbeat;
|
||||
|
||||
#endif
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
#include <time.h>
|
||||
#include <dcb.h>
|
||||
|
||||
#include <hk_heartbeat.h>
|
||||
/**
|
||||
* @file housekeeper.h A mechanism to have task run periodically
|
||||
*
|
||||
@ -52,12 +52,6 @@ typedef struct hktask {
|
||||
*next; /*< Next task in the list */
|
||||
} HKTASK;
|
||||
|
||||
/**
|
||||
* The global housekeeper heartbeat value. This value is increamente
|
||||
* every 100ms and may be used for crude timing etc.
|
||||
*/
|
||||
extern unsigned long hkheartbeat;
|
||||
|
||||
extern void hkinit();
|
||||
extern int hktask_add(char *name, void (*task)(void *), void *data, int frequency);
|
||||
extern int hktask_oneshot(char *name, void (*task)(void *), void *data, int when);
|
||||
|
||||
Reference in New Issue
Block a user