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

Unified Diff: include/core/SkAtomics.h

Issue 1039323002: Extract the spinlock from SkOnce as SkSpinlock. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: quotes Created 5 years, 9 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 | « no previous file | include/core/SkOnce.h » ('j') | include/ports/SkAtomics_sync.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkAtomics.h
diff --git a/include/core/SkAtomics.h b/include/core/SkAtomics.h
index cdd39ef4b753ffdba6ccc577eb014f2868451dcd..9866db4860cea31df1289391748e23bb7288cc58 100644
--- a/include/core/SkAtomics.h
+++ b/include/core/SkAtomics.h
@@ -1,3 +1,10 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
#ifndef SkAtomics_DEFINED
#define SkAtomics_DEFINED
@@ -27,6 +34,9 @@ bool sk_atomic_compare_exchange(T*, T* expected, T desired,
sk_memory_order success = sk_memory_order_seq_cst,
sk_memory_order failure = sk_memory_order_seq_cst);
+template <typename T>
+T sk_atomic_exchange(T*, T, sk_memory_order = sk_memory_order_seq_cst);
+
// A little wrapper class for small T (think, builtins: int, float, void*) to
// ensure they're always used atomically. This is our stand-in for std::atomic<T>.
template <typename T>
« no previous file with comments | « no previous file | include/core/SkOnce.h » ('j') | include/ports/SkAtomics_sync.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698