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

Unified Diff: include/private/SkOncePtr.h

Issue 1898413004: Revert of SkOnce: 2 bytes -> 1 byte (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/private/SkOnce.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkOncePtr.h
diff --git a/include/private/SkOncePtr.h b/include/private/SkOncePtr.h
index b60d968b4a4ef7825d16c558cbaf822206f94abe..3c1ab634ee4397d747cebf7fcfbfb616b189f1fb 100644
--- a/include/private/SkOncePtr.h
+++ b/include/private/SkOncePtr.h
@@ -66,9 +66,8 @@
if (state == 0) {
// It looks like no one has tried to create our pointer yet.
// We try to claim that task by atomically swapping our state from '0' to '1'.
- // See SkOnce.h for why we use an acquire memory order here rather than relaxed.
if (sk_atomic_compare_exchange(
- &fState, &state, (uintptr_t)1, sk_memory_order_acquire, sk_memory_order_acquire)) {
+ &fState, &state, (uintptr_t)1, sk_memory_order_relaxed, sk_memory_order_relaxed)) {
// We've claimed it. Create our pointer and store it into fState.
state = (uintptr_t)f();
SkASSERT(state > 1);
« no previous file with comments | « include/private/SkOnce.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698