
8 Jul
2006
8 Jul
'06
5:50 p.m.
Michael van der Westhuizen wrote:
inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { __asm__ __volatile__( "cas %0, %2, %1" : "+m" (*dest_), "+r" (swap_) : "r" (compare_) : "memory" );
return swap_; }
I've just tested with the above code, and it works perfectly. Test results below.
Great! Added to CVS, let's hope that I haven't broken anything in the final round. Regarding the Solaris situation, perhaps we need to just depend on the user-specified BOOST_USE_SOLARIS_ATOMICS for now? Has Solaris 5.11 been officially released?