diff --git a/include/proto/applet.h b/include/proto/applet.h index 914b496f52..8024981e6a 100644 --- a/include/proto/applet.h +++ b/include/proto/applet.h @@ -30,6 +30,7 @@ #include extern unsigned int nb_applets; +extern unsigned long active_applets_mask; extern unsigned int applets_active_queue; __decl_hathreads(extern HA_SPINLOCK_T applet_active_lock); extern struct list applet_active_queue; @@ -113,6 +114,7 @@ static inline void __appctx_wakeup(struct appctx *appctx) if (LIST_ISEMPTY(&appctx->runq)) { LIST_ADDQ(&applet_active_queue, &appctx->runq); applets_active_queue++; + active_applets_mask |= appctx->thread_mask; } } diff --git a/src/applet.c b/src/applet.c index 1df6b091ea..e24f66d05c 100644 --- a/src/applet.c +++ b/src/applet.c @@ -21,6 +21,7 @@ #include unsigned int nb_applets = 0; +unsigned long active_applets_mask = 0; unsigned int applets_active_queue = 0; __decl_hathreads(HA_SPINLOCK_T applet_active_lock); /* spin lock related to applet active queue */ @@ -48,7 +49,7 @@ void applet_run_active() } curr = next; } - + active_applets_mask &= ~tid_bit; HA_SPIN_UNLOCK(APPLETS_LOCK, &applet_active_lock); /* The list is only scanned from the head. This guarantees that if any