Define an utility function to report if a watcher is currently attached
on a target. This will notably be used to implement a new CLI command
"show default-server".
w->off = attach_off;
}
+/* Returns true if <w> is currently tracking a target else false. */
+static __inline int watcher_is_attached(const struct watcher *w)
+{
+ return MT_LIST_INLIST(&w->el);
+}
+
/* Tracks <target> via <w> watcher. Invalid if <w> is already attached. */
static __inline void watcher_attach(struct watcher *w, void *target)
{