diff options
author | Christopher Faylor <me@cgf.cx> | 2013-01-07 16:01:10 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-01-07 16:01:10 +0000 |
commit | 8f3f61eb961322d7b50be81fbe51195565967738 (patch) | |
tree | 93a543a2fe770e4174e56ae1469a9c0e53af2435 /winsup/cygwin/thread.h | |
parent | 6cb6ea9cb416fb38866e103678a7d27d15308348 (diff) | |
download | cygnal-8f3f61eb961322d7b50be81fbe51195565967738.tar.gz cygnal-8f3f61eb961322d7b50be81fbe51195565967738.tar.bz2 cygnal-8f3f61eb961322d7b50be81fbe51195565967738.zip |
* thread.cc (pthread_rwlock::add_reader): Perform new operation here and return
pointer to allocated RWLOCK_READER structure.
(pthread_rwlock::rdlock): Reorganize to reflect new add_reader functionality.
(pthread_rwlock::tryrdlock): Ditto. Remove unneeded call to lookup_reader().
* thread.h (pthread_rwlock::RWLOCK_READER::RWLOCK_READER): New constructor.
(pthread_rwlock::add_reader): Reflect new functionality.
Diffstat (limited to 'winsup/cygwin/thread.h')
-rw-r--r-- | winsup/cygwin/thread.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index a0412e1d0..1c7b7c62a 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -555,6 +555,7 @@ public: struct RWLOCK_READER *next; pthread_t thread; unsigned long n; + RWLOCK_READER (): next (NULL), thread (pthread::self ()), n (0) {} } *readers; fast_mutex readers_mx; @@ -583,7 +584,7 @@ public: private: static List<pthread_rwlock> rwlocks; - void add_reader (struct RWLOCK_READER *rd); + RWLOCK_READER *add_reader (); void remove_reader (struct RWLOCK_READER *rd); struct RWLOCK_READER *lookup_reader (pthread_t thread); |