Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Subject: Re: pthread_mutex_trylock does not lock From: Robert Collins To: Chris Knight Cc: cygwin AT cygwin DOT com In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Ab6A2nz5kxNN1Us5EVwE" Date: 03 Dec 2002 22:11:32 +1100 Message-Id: <1038913892.10594.35.camel@lifelesswks> Mime-Version: 1.0 --=-Ab6A2nz5kxNN1Us5EVwE Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2002-12-03 at 20:37, Chris Knight wrote: > Hello, >=20 > 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 --=20 --- GPG key available at: http://users.bigpond.net.au/robertc/keys.txt. --- --=-Ab6A2nz5kxNN1Us5EVwE Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA97JFkI5+kQ8LJcoIRAtYeAKCO66wsy4XAe1CLsIoLrjLvsdQtXQCgxeyc pqvHJNCxTXSkBLNG3du2ixM= =Io/l -----END PGP SIGNATURE----- --=-Ab6A2nz5kxNN1Us5EVwE--