]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: task/notification: Is notifications registered ?
authorThierry FOURNIER <thierry.fournier@ozon.io>
Wed, 30 May 2018 09:40:08 +0000 (11:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 May 2018 08:58:41 +0000 (10:58 +0200)
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

index ef296f6e97a39b4362bdcf4fa0d23718636486ec..760b368b57e44943398b2153c52b97bf260bb452 100644 (file)
@@ -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