Add _TICKET_LOCK_INITIALIZER to <sys/lock.h>

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>
This commit is contained in:
Sebastian Huber 2016-11-17 11:21:28 +01:00 committed by Corinna Vinschen
parent 9bbc5a34f2
commit ba49de472f
1 changed files with 3 additions and 1 deletions

View File

@ -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 }