This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] add support for PTHREAD_MUTEX_NORMAL
- From: "Cygwin \(Robert Collins\)" <rbcollins at cygwin dot com>
- To: "Thomas Pfaff" <tpfaff at gmx dot net>,<cygwin-patches at cygwin dot com>
- Date: Thu, 13 Mar 2003 16:53:40 +1100
- Subject: Re: [PATCH] add support for PTHREAD_MUTEX_NORMAL
- References: <Pine.WNT.4.44.0302271028080.285-201000@algeria.intern.net>
- Reply-to: "Cygwin \(Robert Collins\)" <rbcollins at cygwin dot com>
This:
if (1 == InterlockedIncrement ((long *)&lock_counter))
is not safe. You can only check for equal to 0, less than 0, and greater
than 0 with InterlockedIncrement | Decrement.
Secondly, IIRC lock_counter should be long, so the (long *) typecasting
isn't needed.
Rob