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

Side by Side Diff: src/ports/SkAtomics_sync.h

Issue 305753002: Spin off just SkLazyFnPtr from 305513002. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkThreadPriv again Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/core/SkUtils.cpp ('k') | src/ports/SkAtomics_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkAtomics_sync_DEFINED 8 #ifndef SkAtomics_sync_DEFINED
9 #define SkAtomics_sync_DEFINED 9 #define SkAtomics_sync_DEFINED
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 static inline __attribute__((always_inline)) void sk_membar_acquire__after_atomi c_dec() { } 27 static inline __attribute__((always_inline)) void sk_membar_acquire__after_atomi c_dec() { }
28 28
29 static inline __attribute__((always_inline)) bool sk_atomic_cas(int32_t* addr, 29 static inline __attribute__((always_inline)) bool sk_atomic_cas(int32_t* addr,
30 int32_t before, 30 int32_t before,
31 int32_t after) { 31 int32_t after) {
32 return __sync_bool_compare_and_swap(addr, before, after); 32 return __sync_bool_compare_and_swap(addr, before, after);
33 } 33 }
34 34
35 static inline __attribute__((always_inline)) void* sk_atomic_cas(void** addr,
36 void* before,
37 void* after) {
38 return __sync_val_compare_and_swap(addr, before, after);
39 }
40
35 static inline __attribute__((always_inline)) void sk_membar_acquire__after_atomi c_conditional_inc() { } 41 static inline __attribute__((always_inline)) void sk_membar_acquire__after_atomi c_conditional_inc() { }
36 42
37 #endif 43 #endif
OLDNEW
« no previous file with comments | « src/core/SkUtils.cpp ('k') | src/ports/SkAtomics_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698