equal
deleted
inserted
replaced
197 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const { |
197 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const { |
198 STATIC_ASSERT(8 == sizeof(I)); |
198 STATIC_ASSERT(8 == sizeof(I)); |
199 STATIC_ASSERT(8 == sizeof(D)); |
199 STATIC_ASSERT(8 == sizeof(D)); |
200 |
200 |
201 return __sync_add_and_fetch(dest, add_value); |
201 return __sync_add_and_fetch(dest, add_value); |
202 } |
|
203 |
|
204 inline void Atomic::inc(volatile jint* dest) { |
|
205 add(1, dest); |
|
206 } |
|
207 |
|
208 inline void Atomic::inc_ptr(volatile intptr_t* dest) { |
|
209 add_ptr(1, dest); |
|
210 } |
|
211 |
|
212 inline void Atomic::inc_ptr(volatile void* dest) { |
|
213 add_ptr(1, dest); |
|
214 } |
|
215 |
|
216 inline void Atomic::dec(volatile jint* dest) { |
|
217 add(-1, dest); |
|
218 } |
|
219 |
|
220 inline void Atomic::dec_ptr(volatile intptr_t* dest) { |
|
221 add_ptr(-1, dest); |
|
222 } |
|
223 |
|
224 inline void Atomic::dec_ptr(volatile void* dest) { |
|
225 add_ptr(-1, dest); |
|
226 } |
202 } |
227 |
203 |
228 inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) { |
204 inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) { |
229 #ifdef ARM |
205 #ifdef ARM |
230 return arm_lock_test_and_set(dest, exchange_value); |
206 return arm_lock_test_and_set(dest, exchange_value); |