delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
Date: | Mon, 1 Dec 2008 22:07:04 -0500 |
From: | Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: pthread_rwlock_rdlock() returns EDEADLK when trying to call it > once |
Message-ID: | <20081202030703.GB2466@ednor.casa.cgf.cx> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <aa7d410c0812011241n21a0b6du5c738f9cc88b9257 AT mail DOT gmail DOT com> |
MIME-Version: | 1.0 |
In-Reply-To: | <aa7d410c0812011241n21a0b6du5c738f9cc88b9257@mail.gmail.com> |
User-Agent: | Mutt/1.5.16 (2007-06-09) |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
On Mon, Dec 01, 2008 at 09:41:53PM +0100, kalle ko wrote: >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. You've located the code. Feel free to suggest a patch. cgf -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |