Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: include/private/SkAtomics.h

Issue 1867863002: Convert SkRefCnt to std::atomic. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore to 1. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkRefCnt.h ('k') | include/private/SkOnce.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkAtomics.h
diff --git a/include/private/SkAtomics.h b/include/private/SkAtomics.h
index 249723d785865610fb46a00bd3d259e0a22c1d1d..bfe93d8bacd2a9ddf5d59774784f0cd2262f322c 100644
--- a/include/private/SkAtomics.h
+++ b/include/private/SkAtomics.h
@@ -159,32 +159,4 @@ inline int32_t sk_atomic_add(int32_t* ptr, int32_t v) { return sk_atomic_fetch_a
inline int64_t sk_atomic_inc(int64_t* ptr) { return sk_atomic_fetch_add<int64_t>(ptr, +1); }
-inline bool sk_atomic_cas(int32_t* ptr, int32_t expected, int32_t desired) {
- return sk_atomic_compare_exchange(ptr, &expected, desired);
-}
-
-inline void* sk_atomic_cas(void** ptr, void* expected, void* desired) {
- (void)sk_atomic_compare_exchange(ptr, &expected, desired);
- return expected;
-}
-
-inline int32_t sk_atomic_conditional_inc(int32_t* ptr) {
- int32_t prev = sk_atomic_load(ptr);
- do {
- if (0 == prev) {
- break;
- }
- } while(!sk_atomic_compare_exchange(ptr, &prev, prev+1));
- return prev;
-}
-
-template <typename T>
-T sk_acquire_load(T* ptr) { return sk_atomic_load(ptr, sk_memory_order_acquire); }
-
-template <typename T>
-void sk_release_store(T* ptr, T val) { sk_atomic_store(ptr, val, sk_memory_order_release); }
-
-inline void sk_membar_acquire__after_atomic_dec() {}
-inline void sk_membar_acquire__after_atomic_conditional_inc() {}
-
#endif//SkAtomics_DEFINED
« no previous file with comments | « include/core/SkRefCnt.h ('k') | include/private/SkOnce.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698