diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-27 14:20:14 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-05 14:56:13 +0200 |
commit | 3a79700c2d994c635b2af053c8293d19f2e12bd5 (patch) | |
tree | 88f53d2cba203a1d5366b6858ed8fcc3d74c3fb5 /newlib | |
parent | 55c5dda9b5d2627ef7bb5568f11632c4c03bf41b (diff) | |
download | newlib-3a79700c2d994c635b2af053c8293d19f2e12bd5.zip newlib-3a79700c2d994c635b2af053c8293d19f2e12bd5.tar.gz newlib-3a79700c2d994c635b2af053c8293d19f2e12bd5.tar.bz2 |
RTEMS: Make pthread_mutex_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/libc/sys/rtems/include/sys/_pthreadtypes.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h b/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h index 0b607f7..b091ebb 100644 --- a/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h +++ b/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h @@ -131,9 +131,35 @@ typedef struct { #endif /* !defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) */ -typedef __uint32_t pthread_mutex_t; /* identify a mutex */ +struct _Chain_Node { + struct _Chain_Node *_next; + struct _Chain_Node *_previous; +}; + +struct _RBTree_Node { + struct _RBTree_Node *_left; + struct _RBTree_Node *_right; + struct _RBTree_Node *_parent; + int _color; +}; + +struct _Priority_Node { + union { + struct _RBTree_Node _RBTree; + struct _Chain_Node _Chain; + } _Node; + __uint64_t _priority; +}; -#define _PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF) +typedef struct { + unsigned long _flags; + struct _Mutex_recursive_Control _Recursive; + struct _Priority_Node _Priority_ceiling; + const struct _Scheduler_Control *_scheduler; +} pthread_mutex_t; + +#define _PTHREAD_MUTEX_INITIALIZER \ + { 0, _MUTEX_RECURSIVE_INITIALIZER, { { 0, 0, 0, 0 }, 0 }, 0 } typedef struct { int is_initialized; |