This is the mail archive of the cygwin-patches@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: [PATCH] add support for PTHREAD_MUTEX_NORMAL


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



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