summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-17 17:16:20 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-17 17:16:20 -0500
commite882756311c7b06e59fcc8e582f03852b7dcfd30 (patch)
treeaead1d2311ed1d3b68dd2b1f02ff6eed2c5ea2ea /src/internal
parent4fd159568aa1852fbbe6c11d35ccecaec3715d7c (diff)
downloadmusl-e882756311c7b06e59fcc8e582f03852b7dcfd30.tar.gz
reorganize pthread data structures and move the definitions to alltypes.h
this allows sys/types.h to provide the pthread types, as required by POSIX. this design also facilitates forcing ABI-compatible sizes in the arch-specific alltypes.h, while eliminating the need for developers changing the internals of the pthread types to poke around with arch-specific headers they may not be able to test.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/pthread_impl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index e481ab5a..615af708 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -38,6 +38,25 @@ struct pthread {
pthread_attr_t attr;
};
+#define __SU (sizeof(size_t)/sizeof(int))
+
+#define _a_stacksize __u.__s[0]
+#define _a_guardsize __u.__s[1]
+#define _a_detach __u.__i[2*__SU+0]
+#define _m_type __u.__i[0]
+#define _m_lock __u.__i[1]
+#define _m_waiters __u.__i[2]
+#define _m_owner __u.__i[3]
+#define _c_block __u.__i[0]
+#define _rw_wrlock __u.__i[0]
+#define _rw_readers __u.__i[1]
+#define _rw_waiters __u.__i[2]
+#define _rw_owner __u.__i[3]
+#define _b_count __u.__i[0]
+#define _b_limit __u.__i[1]
+#define _b_left __u.__i[2]
+#define _b_waiters __u.__i[3]
+
#include "pthread_arch.h"
#define SIGCANCEL 32