This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_mutex_trylock does not lock


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

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]