return;
}
+ /* The watchdog thread can't use Jmsg directly, we always queued it */
+ if (is_watchdog()) {
+ va_start(arg_ptr, fmt);
+ bvsnprintf(rbuf+len, sizeof(rbuf)-len, fmt, arg_ptr);
+ va_end(arg_ptr);
+ Qmsg(jcr, type, mtime, "%s", rbuf);
+ return;
+ }
+
msgs = NULL;
if (!jcr) {
jcr = get_jcr_from_tsd();
}
if (jcr) {
+ if (!jcr->dequeuing_msgs) { /* Avoid recursion */
+ /* Dequeue messages to keep the original order */
+ dequeue_messages(jcr);
+ }
msgs = jcr->jcr_msgs;
JobId = jcr->JobId;
}
watchdog_t *new_watchdog(void);
bool register_watchdog(watchdog_t *wd);
bool unregister_watchdog(watchdog_t *wd);
+bool is_watchdog();
/* timers.c */
btimer_t *start_child_timer(JCR *jcr, pid_t pid, uint32_t wait);
static dlist *wd_queue;
static dlist *wd_inactive;
+/*
+ * Returns: 0 if the current thread is NOT the watchdog
+ * 1 if the current thread is the watchdog
+ */
+bool is_watchdog()
+{
+ if (wd_is_init && pthread_equal(pthread_self(), wd_tid)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
/*
* Start watchdog thread
*