public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] Add _TICKET_LOCK_INITIALIZER to <sys/lock.h>
@ 2016-11-17 10:21 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2016-11-17 10:21 UTC (permalink / raw)
  To: newlib; +Cc: Sebastian Huber

Add _TICKET_LOCK_INITIALIZER to statically initialize a
_Ticket_lock_Control structure.  This makes it possible to embed a
ticket lock in other structures outside of <sys/lock.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
 newlib/libc/sys/rtems/include/sys/lock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/include/sys/lock.h b/newlib/libc/sys/rtems/include/sys/lock.h
index f716a69..c0549db 100644
--- a/newlib/libc/sys/rtems/include/sys/lock.h
+++ b/newlib/libc/sys/rtems/include/sys/lock.h
@@ -70,7 +70,9 @@ struct _Futex_Control {
 	struct _Thread_queue_Queue _Queue;
 };
 
-#define _THREAD_QUEUE_INITIALIZER { { 0, 0 }, 0, 0 }
+#define _TICKET_LOCK_INITIALIZER { 0, 0 }
+
+#define _THREAD_QUEUE_INITIALIZER { _TICKET_LOCK_INITIALIZER, 0, 0 }
 
 #define _MUTEX_INITIALIZER { _THREAD_QUEUE_INITIALIZER }
 
-- 
1.8.4.5

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-17 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17 10:21 [PATCH v2] Add _TICKET_LOCK_INITIALIZER to <sys/lock.h> Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).