This is the mail archive of the
cygwin
mailing list for the Cygwin project.
pthread_rwlock_rdlock() returns EDEADLK when trying to call it > once
- From: "kalle ko" <cocalle at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 1 Dec 2008 21:41:53 +0100
- Subject: pthread_rwlock_rdlock() returns EDEADLK when trying to call it > once
Possible bug in winsup/cygwin/thread.cc:
...
int
pthread_rwlock::rdlock ()
{
int result = 0;
struct RWLOCK_READER *reader;
pthread_t self = pthread::self ();
mtx.lock ();
if (lookup_reader (self))
{
result = EDEADLK;
goto DONE;
}
...
It doesn't seem like it's possible for a thread to call
pthread_rwlock_rdlock() multiple times, and if a thread does, it will get
a EDEADLK error.
http://opengroup.org/onlinepubs/007908799/xsh/pthread_rwlock_rdlock.html:
...
A thread may hold multiple concurrent read locks on rwlock (that is,
successfully call the pthread_rwlock_rdlock() function n times).
...
[EDEADLK]
The current thread already owns the read-write lock for writing.
...
I noticed this when one of my tests failed.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/