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="=-3Sn8EZ1XC1S3ZkHMkTkL" Date: 03 Dec 2002 23:14:20 +1100 Message-Id: <1038917660.10594.47.camel@lifelesswks> Mime-Version: 1.0 --=-3Sn8EZ1XC1S3ZkHMkTkL Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2002-12-03 at 23:06, Chris Knight wrote: > Hello Rob, >=20 > I have changed the code, see below. I now set the type to > PTHREAD_MUTEX_NORMAL but that also does not block. The only documentatio= n > on cygwin threads say this is the same as PTHREAD_MUTEX_FAST_NP=20 What documentation says that? The PTHREAD_MUTEX_FAST_NP under linux is NP -> NON PORTABLE. In other words, expect it to break on all other platforms. > which I know > blocks under Linux. Linux man pages also say that this is the default mu= tex > type. >=20 > Do you know the right type for NONRECURSIVE threads. We don't support NONRECURSIVE mutex's. I don't know what you mean by NORECURSIVE threads. If you need a portable way to do single entrancy within a single thread and across threads, you are best to use a semaphore, not a mutex. Cheers, Rob PS I've copied the list, so the solution is in the archives. --=-3Sn8EZ1XC1S3ZkHMkTkL 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) iD8DBQA97KAcI5+kQ8LJcoIRAmzEAJ9HHS80CoSZyw1xyAyGl/UNpe6tBQCgkamc FoSJKANppODu6c4tXNKULEE= =KW66 -----END PGP SIGNATURE----- --=-3Sn8EZ1XC1S3ZkHMkTkL--