From 9d5422a4b7e71294cf7ce16d60490d907cc92f48 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Wed, 30 May 2018 11:40:08 +0200 Subject: [PATCH] MINOR: task/notification: Is notifications registered ? This function returns true is some notifications are registered. This function is usefull for the following patch BUG/MEDIUM: lua/socket: Sheduling error on write: may dead-lock It should be backported in 1.6, 1.7 and 1.8 --- include/proto/task.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/proto/task.h b/include/proto/task.h index ef296f6e97..760b368b57 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -462,6 +462,13 @@ static inline void notification_wake(struct list *wake) } } +/* This function returns true is some notification are pending + */ +static inline int notification_registered(struct list *wake) +{ + return !LIST_ISEMPTY(wake); +} + /* * This does 3 things : * - wake up all expired tasks -- 2.47.3