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 unsigned long Interlocked functions


On Thu, Mar 20, 2003 at 10:20:14AM +1100, Robert Collins wrote:
>Looks good to me. Chris, you happy with the winbase stuff?

I am not sure I understand the need for the UL uses since they are
just wrappers around InterlockedIncrement.  Why lie about this by
removing the typecasts?

Also, although it has nothing to do with this particular patch, I can
see that some (1 == foo) style conditional tests have crept in.  While I
understand why some people like this, this usage is counter to the rest
of cygwin which uses foo == 1.

cgf

>On Thu, 2003-03-20 at 00:49, Thomas Pfaff wrote:
>> 2003-03-19  Thomas Pfaff  <tpfaff at gmx dot net>
>> 
>> 	* thread.cc (pthread_cond::Wait): Remove typecasts for unsigned
>> 	long values when calling Interlocked functions. Use new UL functions
>> 	instead.
>> 	(pthread_mutex::_Lock): Ditto.
>> 	(pthread_mutex::_TryLock): Ditto.
>> 	* winbase.h (InterlockedIncrementUL): New inline function for type
>> 	safety with unsigned parameters.
>> 	(InterlockedDecrementUL): Ditto.
>> 	(InterlockedExchangeUL): Ditto.
>> 	(InterlockedCompareExchangeUL): Ditto.


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