]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/watchdog.c
More changes to ensure that during thread switches the jcr
[bacula/bacula] / bacula / src / lib / watchdog.c
index 2e39e7349b1a8664184b6aab06f47dbea1e36c7e..770597dbbac3729f98a1c40dc170365a6f896213 100644 (file)
@@ -38,8 +38,8 @@
 #include "jcr.h"
 
 /* Exported globals */
-time_t watchdog_time = 0;             /* this has granularity of SLEEP_TIME */
-time_t watchdog_sleep_time = 60;      /* examine things every 60 seconds */
+utime_t watchdog_time = 0;            /* this has granularity of SLEEP_TIME */
+utime_t watchdog_sleep_time = 60;     /* examine things every 60 seconds */
 
 /* Locals */
 static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -244,8 +244,9 @@ extern "C" void *watchdog_thread(void *arg)
    struct timespec timeout;
    struct timeval tv;
    struct timezone tz;
-   time_t next_time;
+   utime_t next_time;
 
+   set_jcr_in_tsd(INVALID_JCR);
    Dmsg0(800, "NicB-reworked watchdog thread entered\n");
 
    while (!quit) {