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

Side by Side Diff: src/core/SkThread.h

Issue 300843012: Revert of Spin off just SkLazyFnPtr from 305513002. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkLazyFnPtr.h ('k') | src/core/SkUtils.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkThread_DEFINED 8 #ifndef SkThread_DEFINED
9 #define SkThread_DEFINED 9 #define SkThread_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 * This must act as a release (SL/S) memory barrier and as a compiler barrier. 26 * This must act as a release (SL/S) memory barrier and as a compiler barrier.
27 */ 27 */
28 static int32_t sk_atomic_dec(int32_t* addr); 28 static int32_t sk_atomic_dec(int32_t* addr);
29 29
30 /** Atomic compare and set. 30 /** Atomic compare and set.
31 * If *addr == before, set *addr to after and return true, otherwise return fal se. 31 * If *addr == before, set *addr to after and return true, otherwise return fal se.
32 * This must act as a release (SL/S) memory barrier and as a compiler barrier. 32 * This must act as a release (SL/S) memory barrier and as a compiler barrier.
33 */ 33 */
34 static bool sk_atomic_cas(int32_t* addr, int32_t before, int32_t after); 34 static bool sk_atomic_cas(int32_t* addr, int32_t before, int32_t after);
35 35
36 /** Atomic compare and set, for pointers.
37 * If *addr == before, set *addr to after. Always returns previous value of *a ddr.
38 * This must act as a compiler barrier.
39 */
40 static void* sk_atomic_cas(void** addr, void* before, void* after);
41
42 /** If sk_atomic_dec does not act as an acquire (L/SL) barrier, 36 /** If sk_atomic_dec does not act as an acquire (L/SL) barrier,
43 * this must act as an acquire (L/SL) memory barrier and as a compiler barrier. 37 * this must act as an acquire (L/SL) memory barrier and as a compiler barrier.
44 */ 38 */
45 static void sk_membar_acquire__after_atomic_dec(); 39 static void sk_membar_acquire__after_atomic_dec();
46 40
47 /** If sk_atomic_conditional_inc does not act as an acquire (L/SL) barrier, 41 /** If sk_atomic_conditional_inc does not act as an acquire (L/SL) barrier,
48 * this must act as an acquire (L/SL) memory barrier and as a compiler barrier. 42 * this must act as an acquire (L/SL) memory barrier and as a compiler barrier.
49 */ 43 */
50 static void sk_membar_acquire__after_atomic_conditional_inc(); 44 static void sk_membar_acquire__after_atomic_conditional_inc();
51 45
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 fMutex = NULL; 108 fMutex = NULL;
115 } 109 }
116 } 110 }
117 111
118 private: 112 private:
119 SkBaseMutex* fMutex; 113 SkBaseMutex* fMutex;
120 }; 114 };
121 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire) 115 #define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire)
122 116
123 #endif 117 #endif
OLDNEW
« no previous file with comments | « src/core/SkLazyFnPtr.h ('k') | src/core/SkUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698