]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/watchdog.h
Fix reporting jobs from state file + misc
[bacula/bacula] / bacula / src / lib / watchdog.h
index 57f9d677b3b9e91f109e9a48f056c8f6212cd1c9..04725cf0189a509bf716cbe37d8850cf342f3c39 100644 (file)
@@ -5,7 +5,7 @@
  *
 */
 /*
-   Copyright (C) 2002 Kern Sibbald and John Walker
+   Copyright (C) 2002-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 
  */
 
-#define TYPE_CHILD   1
-#define TYPE_PTHREAD 2
+enum {
+   TYPE_CHILD = 1,
+   TYPE_PTHREAD, 
+   TYPE_BSOCK 
+};
 
-typedef struct s_btimer_t {
-   struct s_btimer_t *next;
-   struct s_btimer_t *prev;
-   time_t start_time;
-   int32_t  wait;
-   pid_t pid;                         /* process id if TYPE_CHILD */
-   int killed;
-   int type;
-   pthread_t tid;                     /* thread id if TYPE_PTHREAD */
-} btimer_t;
+#define TIMEOUT_SIGNAL SIGUSR2
 
-#define btimer_id btimer_t *
+struct s_watchdog_t {
+        bool one_shot;
+        time_t interval;
+        void (*callback)(struct s_watchdog_t *wd);
+        void (*destructor)(struct s_watchdog_t *wd);
+        void *data;
+        /* Private data below - don't touch outside of watchdog.c */
+        dlink link;
+        time_t next_fire;
+};
+typedef struct s_watchdog_t watchdog_t;