[PATCH] RTEMS: Make pthread_rwlock_t self-contained

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Sep 22 13:59:01 UTC 2017


Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
 newlib/libc/sys/rtems/include/sys/_pthreadtypes.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h b/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h
index 6ffedaebf..9ee443407 100644
--- a/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h
+++ b/newlib/libc/sys/rtems/include/sys/_pthreadtypes.h
@@ -206,9 +206,14 @@ typedef struct {
 /* POSIX Reader/Writer Lock Types */
 
 #if defined(_POSIX_READER_WRITER_LOCKS)
-typedef __uint32_t pthread_rwlock_t;         /* POSIX RWLock Object */
+typedef struct {
+  unsigned long _flags;
+  unsigned int _current_state;
+  unsigned int _number_of_readers;
+  struct _Thread_queue_Queue _Queue;
+} pthread_rwlock_t;
 
-#define _PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) 0xFFFFFFFF)
+#define _PTHREAD_RWLOCK_INITIALIZER { 0, 0, 0, _THREAD_QUEUE_INITIALIZER }
 
 typedef struct {
   int   is_initialized;       /* is this structure initialized? */
-- 
2.12.3



More information about the devel mailing list