Index: pthread_types.h
===================================================================
RCS file: /cvsroot/src/lib/libpthread/pthread_types.h,v
retrieving revision 1.13
diff -u -u -r1.13 pthread_types.h
--- pthread_types.h 2 Aug 2008 19:46:30 -0000 1.13
+++ pthread_types.h 20 Jun 2015 16:03:04 -0000
@@ -84,6 +84,23 @@
};
/*
+ * libc++ expects to be using PTHREAD_MUTEX_INITIALIZER as a member
+ * initializer. This does not work for volatile types. Since c++
+ * does not touch the guts of those types, we redefine them as non-volatile
+ */
+#ifdef __cplusplus
+# ifdef __CPU_SIMPLE_LOCK_PAD
+# define __pthread_mutex_spin_t unsigned char
+# else
+# define __pthread_mutex_spin_t unsigned int
+# endif
+# define __pthread_mutex_volatile
+#else
+# define __pthread_mutex_spin_t pthread_spin_t
+# define __pthread_mutex_volatile volatile
+#endif
+
+/*
* ptm_owner is the actual lock field which is locked via CAS operation.
* This structure's layout is designed to compatible with the previous
* version used in SA pthreads.
@@ -100,16 +117,16 @@
#endif
struct __pthread_mutex_st {
unsigned int ptm_magic;
- pthread_spin_t ptm_errorcheck;
+ __pthread_mutex_spin_t ptm_errorcheck;
#ifdef __CPU_SIMPLE_LOCK_PAD
uint8_t ptm_pad1[3];
#endif
- pthread_spin_t ptm_interlock; /* unused - backwards compat */
+ __pthread_mutex_spin_t ptm_interlock; /* unused - backwards compat */
#ifdef __CPU_SIMPLE_LOCK_PAD
uint8_t ptm_pad2[3];
#endif
- volatile pthread_t ptm_owner;
- pthread_t * volatile ptm_waiters;
+ __pthread_mutex_volatile pthread_t ptm_owner;
+ pthread_t * __pthread_mutex_volatile ptm_waiters;
unsigned int ptm_recursed;
void *ptm_spare2; /* unused - backwards compat */
};