X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Nicholas Sherlock Subject: Re: simple multithread program fails on Cygwin, succeeds on Linux Date: Tue, 11 Aug 2009 00:32:24 +1200 Lines: 24 Message-ID: References: <200908101213 DOT 17744 DOT bruno AT clisp DOT org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0 In-Reply-To: <200908101213.17744.bruno@clisp.org> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Bruno Haible wrote: > Hi, > > The attached test program for pthread_once uses the following basic POSIX > threads functions: > pthread_create > pthread_join > pthread_mutex_init > pthread_mutex_lock > pthread_mutex_unlock > pthread_once > pthread_rwlock_init > pthread_rwlock_rdlock > pthread_rwlock_unlock > pthread_rwlock_wrlock In Cygwin 1.5 there was a bug that meant that you could not lock a rwlock recursively for read (it would just deadlock on the second acquire). I didn't study the code for very long, but this might be the problem you're encountering. In any case, Cygwin 1.7 fixes at least one problem with rwlocks so it's a good upgrade choice. Cheers, Nicholas Sherlock -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple