From e882756311c7b06e59fcc8e582f03852b7dcfd30 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 17 Feb 2011 17:16:20 -0500 Subject: 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. --- src/internal/pthread_impl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/internal') 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 -- cgit v1.2.1