X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 	tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49ADFA41.4050308@gmail.com>
Date: Wed, 04 Mar 2009 03:49:21 +0000
From: Dave Korn <dave.korn.cygwin@googlemail.com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: R: Cygwin PThreads bug?
References: <568419.8347.qm@web25006.mail.ukl.yahoo.com>
In-Reply-To: <568419.8347.qm@web25006.mail.ukl.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Marco Atzeri wrote:

> --- Mer 4/3/09, Nicholas Sherlock  ha scritto:

>> This C program:

>> Should run correctly. That is, the second call to
>> pthread_rwlock_rdlock should either succeed (returning
>> zero), having acquired the read lock a second time, or it
>> should fail and return EAGAIN, if the number of simultaneous
>> allowed read locks has been exceeded. It should not fail and
>> return EDEADLK (45), which it is currently doing. Am I
>> reading the spec wrong or is Cygwin non-conforming?

  Cygwin has a bug, your reading is correct.  Or, I should say, "had" a bug,
since:

> on 
> $ uname -a
> CYGWIN_NT-5.1 ITQMOZCAS2NB007 1.7.0(0.200/5/3) 2009-02-20 17:20 i686 Cygwin
> 
> compiled with gcc-4
> 
> $ ./pthread.exe 
> Err 0

  And with gcc3 as well; and neither compiler can make it work on 1.5.  So
it's a bug that was fixed sometime after 1.5 and before 1.7.

    cheers,
      DaveK


--
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/

