Subject: Re: pthread_mutex_trylock does not lock
From: Robert Collins <[email-masked]>
To: Chris Knight <[email-masked]>
Cc: [email-masked]
Date: 03 Dec 2002 22:11:32 +1100

On Tue, 2002-12-03 at 20:37, Chris Knight wrote:
> Hello,
> 
> I think I have found a problem in the "pthread_mutex_trylock" call.  When I
> run the following code both the trylock and lock return immediately.  If I
> compile this under RedHat 8 it works as I would expect with the trylock
> locking the mutex and the lock stopping execution.

Your code is buggy. You are assuming that the default mutex type is
nonrecursive, which is not the case in the version of cygwin you are
using.

If you *need* nonrecursive mutex's, you need to set that type in your
mutexattr struct.

Rob

-- 
---
GPG key available at: http://users.bigpond.net.au/robertc/keys.txt.
---