Module: xenomai-forge
Branch: next
Commit: 4513d667c7d8cd33682b017e6135198bc6060bae
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4513d667c7d8cd33682b017e6135198bc6060bae

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 10 11:39:50 2014 +0200

cobalt/synch: add initializer for simple prio-driven wait queue

---

 include/cobalt/kernel/synch.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/cobalt/kernel/synch.h b/include/cobalt/kernel/synch.h
index a316e3f..8b9fd1c 100644
--- a/include/cobalt/kernel/synch.h
+++ b/include/cobalt/kernel/synch.h
@@ -59,6 +59,18 @@ struct xnsynch {
        void (*cleanup)(struct xnsynch *synch); /* Cleanup handler */
 };
 
+#define XNSYNCH_WAITQUEUE_INITIALIZER(__name) {                \
+               .status = XNSYNCH_PRIO,                 \
+               .wprio = -1,                            \
+               .pendq = LIST_HEAD_INIT((__name).pendq),        \
+               .owner = NULL,                          \
+               .cleanup = NULL,                        \
+               .fastlock = NULL,                       \
+       }
+
+#define DEFINE_XNWAITQ(__name) \
+       struct xnsynch __name = XNSYNCH_WAITQUEUE_INITIALIZER(__name)
+
 static inline void xnsynch_set_status(struct xnsynch *synch, int bits)
 {
        synch->status |= bits;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to