delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/03/07:14:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <rbcollins AT cygwin DOT com>
To: Chris Knight <c DOT knight AT teligent DOT co DOT uk>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <IGEKLLNAJDPOMLJGIFBIMECHCCAA.c.knight@teligent.co.uk>
References: <IGEKLLNAJDPOMLJGIFBIMECHCCAA DOT c DOT knight AT teligent DOT co DOT uk>
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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019