summaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/pthread.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 49f943a..346901a 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -94,16 +94,17 @@ typedef long pthread_condattr_t;
typedef long pthread_rwlockattr_t;
typedef struct {
- pthread_mutex_t lock;
- pthread_cond_t cond;
- int numLocks;
- int writerThreadId;
- int pendingReaders;
- int pendingWriters;
- void* __reserved[4];
+ pthread_mutex_t __unused_lock;
+ pthread_cond_t __unused_cond;
+ volatile int32_t state; // 0=unlock, -1=writer lock, +n=reader lock
+ volatile int32_t writerThreadId;
+ volatile int32_t pendingReaders;
+ volatile int32_t pendingWriters;
+ int32_t attr;
+ void* __reserved[3];
} pthread_rwlock_t;
-#define PTHREAD_RWLOCK_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0, 0, 0, { NULL, NULL, NULL, NULL } }
+#define PTHREAD_RWLOCK_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0, 0, 0, 0, { NULL, NULL, NULL } }
typedef int pthread_key_t;
typedef long pthread_t;