* thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
* thread.cc (pthread_rwlock::rdlock): If a thread already owns a read lock, just count the number of locks for it, per SUSv4. (pthread_rwlock::tryrdlock): Ditto. (pthread_rwlock::unlock): If a thread has more than one concurrent read locks, just count down.
This commit is contained in:
@ -556,6 +556,7 @@ public:
|
||||
{
|
||||
struct RWLOCK_READER *next;
|
||||
pthread_t thread;
|
||||
unsigned long n;
|
||||
} *readers;
|
||||
fast_mutex readers_mx;
|
||||
|
||||
|
Reference in New Issue
Block a user