pthread_rwlock: use a mutex for process-private locks.

* instead of a benaphore.
* define PTHREAD_RWLOCK_INITIALIZER.
* adjust Init(), Destroy(), StructureLock() and StructureUnlock().
This commit is contained in:
Jérôme Duval
2017-07-27 18:33:53 +02:00
parent b34aa933ed
commit 6c9e01265b
3 changed files with 34 additions and 18 deletions
+5 -5
View File
@@ -105,15 +105,15 @@ struct _pthread_rwlock {
__haiku_std_int32 owner;
union {
struct {
__haiku_std_int32 sem;
} shared;
struct {
__haiku_std_int32 lock_sem;
__haiku_std_int32 lock_count;
__haiku_std_int32 mutex;
__haiku_std_int32 unused;
__haiku_std_int32 reader_count;
__haiku_std_int32 writer_count;
void* waiters[2];
} local;
struct {
__haiku_std_int32 sem;
} shared;
} u;
};