1 /* 2 * Copyright 2006 The Android Open Source Project 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "SkThread.h" 9 sk_atomic_inc(int32_t * addr)10int32_t sk_atomic_inc(int32_t* addr) { 11 int32_t value = *addr; 12 *addr = value + 1; 13 return value; 14 } 15 sk_atomic_add(int32_t * addr,int32_t inc)16int32_t sk_atomic_add(int32_t* addr, int32_t inc) { 17 int32_t value = *addr; 18 *addr = value + inc; 19 return value; 20 } 21 sk_atomic_dec(int32_t * addr)22int32_t sk_atomic_dec(int32_t* addr) { 23 int32_t value = *addr; 24 *addr = value - 1; 25 return value; 26 } sk_membar_aquire__after_atomic_dec()27void sk_membar_aquire__after_atomic_dec() { } 28 sk_atomic_conditional_inc(int32_t * addr)29int32_t sk_atomic_conditional_inc(int32_t* addr) { 30 int32_t value = *addr; 31 if (value != 0) ++*addr; 32 return value; 33 } sk_membar_aquire__after_atomic_conditional_inc()34void sk_membar_aquire__after_atomic_conditional_inc() { } 35 SkMutex()36SkMutex::SkMutex() {} 37 ~SkMutex()38SkMutex::~SkMutex() {} 39 40 #ifndef SK_USE_POSIX_THREADS acquire()41void SkMutex::acquire() {} release()42void SkMutex::release() {} 43 #endif 44