Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Date: Sat, 28 May 2005 12:15:15 -0400
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: pthreads, cygwin and pthread_mutex_lock not blocking
Message-ID: <20050528161515.GA1323@trixie.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
References: <44f83c19cc33e4382680fe3758164ccf@rehley.net> <20050527202823.GB4939@trixie.casa.cgf.cx> <0833be552ca5aa00a72ecef822250580@rehley.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <0833be552ca5aa00a72ecef822250580@rehley.net>
User-Agent: Mutt/1.5.8i

On Fri, May 27, 2005 at 04:35:39PM -0700, Peter Rehley wrote:
>On May 27, 2005, at 1:28 PM, Christopher Faylor wrote:
>
>>On Fri, May 27, 2005 at 10:57:34AM -0700, Peter Rehley wrote:
>>>I'm trying to use pthread in cygwin, and I'm expecting the function
>>>pthread_mutex_lock to block when used.  However it is returning error
>>>45 (EDEADLK).    I'm using a static initializer for the thread so the
>>>mutex is type PTHREAD_MUTEX_DEFAULT.
>>>When I look through the pthread code I see that PTHREAD_MUTEX_DEFAULT
>>>is set to PTHREAD_MUTEX_ERRORCHECK,
>>>When I do the same on linux or soloris, the pthread_mutex_lock blocks,
>>>and looking in the pthread.h file on those systems see that  the
>>>default is set to PTHREAD_MUTEX_NORMAL.
>>>
>>>Why is cygwin using PTHREAD_MUTEX_ERRORCHECK as the default?  And what
>>>problems might occur if PTHREAD_MUTEX_DEFAULT is set to
>>>PTHREAD_MUTEX_NORMAL?
>>
>>Why not just try it and report the results?
>Done.  Hangs at WaitForSingleObject.

Can you provide a STC(tm) (simple test case) which demonstrates the
problem both with and without PTHREAD_MUTEX_ERRORCHECK?

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/

