incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: svn commit: r564698 - /incubator/stdcxx/trunk/include/rw/_mutex.h
Date Sun, 12 Aug 2007 21:18:09 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Friday, August 10, 2007 9:30 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: svn commit: r564698 - 
>> /incubator/stdcxx/trunk/include/rw/_mutex.h
>>
>>> 	* _mutex.h (__rw_atomic_preincrement) [_WIN32]: Cast 
>> __x to int& instead of long&
>>> 	to use InterlockedIncrement() optimized function 
>> instead of generic one using
>>> 	critical sections.
>> Really? The long overload should do the "right thing" when 
>> long and int are the same size. If it doesn't it's our bug.
> 
>   It does, but it's defined later than invoked from unsigned in
> overload,
> and compiler invokes the template<long> __rw_atomic_preincrement(...)
> which uses critical section.

Ouch. Good catch! Does this solve the timeout problem in the atomic
tests on Windows?

Btw., this whole header is a mess. It really does need to be cleaned
up. Maybe when we get around to it, we should split up the platform
specific atomic declarations code into their own headers in addition
to simplifying the API and removing the ugly preprocessor logic (as
I mentioned in my response to Travis:
http://www.mail-archive.com/stdcxx-dev@incubator.apache.org/msg04251.html)

Martin

Mime
View raw message