public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] RTEMS: Make pthread_mutex_t self-contained
Date: Thu, 05 Oct 2017 12:57:00 -0000	[thread overview]
Message-ID: <20171005125708.27012.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3a79700c2d994c635b2af053c8293d19f2e12bd5

commit 3a79700c2d994c635b2af053c8293d19f2e12bd5
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Wed Sep 27 14:20:14 2017 +0200

    RTEMS: Make pthread_mutex_t self-contained
    
    Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>

Diff:
---
 newlib/libc/sys/rtems/include/sys/_pthreadtypes.h | 30 +++++++++++++++++++++--
 1 file 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;


                 reply	other threads:[~2017-10-05 12:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171005125708.27012.qmail@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).