aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-04-29 13:58:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 13:58:18 -0700
commite86e51fe7e69ae85ba52de71d19ad62f7bb87ef8 (patch)
tree52c8fe722cd3eb4728235bad89988465a0ab73a4
parentb4c899d48d4c5d8e867beb611551f7b55ec60abb (diff)
Add reminders that these classes have constexpr default constructors.
-rw-r--r--include/private/SkOnce.h2
-rw-r--r--include/private/SkSpinlock.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/private/SkOnce.h b/include/private/SkOnce.h
index 1c68fb7da1..507dcb5b8c 100644
--- a/include/private/SkOnce.h
+++ b/include/private/SkOnce.h
@@ -19,6 +19,8 @@
class SkOnce {
public:
+ constexpr SkOnce() = default;
+
template <typename Fn, typename... Args>
void operator()(Fn&& fn, Args&&... args) {
auto state = fState.load(std::memory_order_acquire);
diff --git a/include/private/SkSpinlock.h b/include/private/SkSpinlock.h
index 2744206871..a5d378289f 100644
--- a/include/private/SkSpinlock.h
+++ b/include/private/SkSpinlock.h
@@ -13,6 +13,8 @@
class SkSpinlock {
public:
+ constexpr SkSpinlock() = default;
+
void acquire() {
// To act as a mutex, we need an acquire barrier when we acquire the lock.
if (fLocked.exchange(true, std::memory_order_acquire)) {