This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH v2] Add _TICKET_LOCK_INITIALIZER to <sys/lock.h>
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Cc: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Date: Thu, 17 Nov 2016 11:21:28 +0100
- Subject: [PATCH v2] Add _TICKET_LOCK_INITIALIZER to <sys/lock.h>
- Authentication-results: sourceware.org; auth=none
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