< prev index next >

src/hotspot/share/runtime/atomic.hpp

Print this page

        

*** 102,113 **** template<typename D, typename I> inline static D add(D volatile* dest, I add_value, atomic_memory_order order = memory_order_conservative); ! template<typename I, typename D> ! inline static D sub(I sub_value, D volatile* dest, atomic_memory_order order = memory_order_conservative); // Atomically increment location. inc() provide: // <fence> increment-dest <membar StoreLoad|StoreStore> // The type D may be either a pointer type, or an integral --- 102,113 ---- template<typename D, typename I> inline static D add(D volatile* dest, I add_value, atomic_memory_order order = memory_order_conservative); ! template<typename D, typename I> ! inline static D sub(D volatile* dest, I sub_value, atomic_memory_order order = memory_order_conservative); // Atomically increment location. inc() provide: // <fence> increment-dest <membar StoreLoad|StoreStore> // The type D may be either a pointer type, or an integral
*** 541,552 **** // Assumes two's complement integer representation. #pragma warning(suppress: 4146) Atomic::add(dest, I(-1), order); } ! template<typename I, typename D> ! inline D Atomic::sub(I sub_value, D volatile* dest, atomic_memory_order order) { STATIC_ASSERT(IsPointer<D>::value || IsIntegral<D>::value); STATIC_ASSERT(IsIntegral<I>::value); // If D is a pointer type, use [u]intptr_t as the addend type, // matching signedness of I. Otherwise, use D as the addend type. typedef typename Conditional<IsSigned<I>::value, intptr_t, uintptr_t>::type PI; --- 541,552 ---- // Assumes two's complement integer representation. #pragma warning(suppress: 4146) Atomic::add(dest, I(-1), order); } ! template<typename D, typename I> ! inline D Atomic::sub(D volatile* dest, I sub_value, atomic_memory_order order) { STATIC_ASSERT(IsPointer<D>::value || IsIntegral<D>::value); STATIC_ASSERT(IsIntegral<I>::value); // If D is a pointer type, use [u]intptr_t as the addend type, // matching signedness of I. Otherwise, use D as the addend type. typedef typename Conditional<IsSigned<I>::value, intptr_t, uintptr_t>::type PI;
< prev index next >