]> git.saurik.com Git - apple/libpthread.git/blobdiff - src/internal.h
libpthread-138.10.4.tar.gz
[apple/libpthread.git] / src / internal.h
index 5a13fe339f4bb5699f4ffcbd5cdc8474fbc8b878..fd5f0cc047ed19890bbc1c0c8e86e7fc81272206 100644 (file)
@@ -250,12 +250,14 @@ typedef struct {
 #if defined(__LP64__)
        uint32_t _pad;
 #endif
-       uint32_t m_tid[2]; // thread id of thread that has mutex locked, misaligned locks may span to first field of m_seq
-       uint32_t m_seq[3];
+       uint32_t m_tid[2]; // thread id of thread that has mutex locked
+       uint32_t m_seq[2]; // mutex sequence id
+       uint32_t m_mis[2]; // for misaligned locks m_tid/m_seq will span into here
 #if defined(__LP64__)
-       uint32_t _reserved;
+       uint32_t _reserved[4];
+#else
+       uint32_t _reserved[1];
 #endif
-       void *reserved2[2];
 } _pthread_mutex;
 
 
@@ -322,8 +324,12 @@ typedef struct {
 #endif
 } _pthread_rwlock;
 
+#include "pthread.h"
 #include "pthread_spis.h"
 
+_Static_assert(sizeof(_pthread_mutex) == sizeof(pthread_mutex_t),
+               "Incorrect _pthread_mutex structure size");
+
 // Internal references to pthread_self() use TSD slot 0 directly.
 inline static pthread_t __attribute__((__pure__))
 _pthread_self_direct(void)