From f41383d9981616f68ca46355833b3f96bc4ead09 Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 16 May 2023 17:05:07 +0800 Subject: [PATCH] notifier: add BLOCKING_INIT_NOTIFIER_HEAD support Signed-off-by: ligd --- include/nuttx/notifier.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/nuttx/notifier.h b/include/nuttx/notifier.h index 84fe58da70..52955551ae 100644 --- a/include/nuttx/notifier.h +++ b/include/nuttx/notifier.h @@ -51,6 +51,14 @@ #define BLOCKING_NOTIFIER_HEAD(name) \ struct blocking_notifier_head name = BLOCKING_NOTIFIER_INIT(name) +#define BLOCKING_INIT_NOTIFIER_HEAD(name) \ + do \ + { \ + nxmutex_init(&(name)->mutex); \ + (name)->head = NULL; \ + } \ + while (0) + /**************************************************************************** * Public Type Definitions ****************************************************************************/