From dcf8a19c8d08d7e730d3862c88396fdcdfa2813f Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Wed, 10 Jan 2018 12:05:34 -0800 Subject: [PATCH] Let Futex import base-class ctors Summary: [Folly] Let `Futex` import base-class ctors. Rather than needing to define ctors and inherit `boost::noncopyable`. Reviewed By: WillerZ Differential Revision: D6674054 fbshipit-source-id: 59e0a4815682b227346954fe47c6eda49e3ad62f --- folly/SharedMutex.h | 2 +- folly/SpinLock.h | 2 ++ folly/concurrency/DynamicBoundedQueue.h | 3 ++- folly/detail/Futex.h | 7 ++----- folly/experimental/FlatCombiningPriorityQueue.h | 4 ++-- folly/fibers/Baton.h | 2 +- folly/synchronization/detail/ThreadCachedInts.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/folly/SharedMutex.h b/folly/SharedMutex.h index ce160f80..976c6e09 100644 --- a/folly/SharedMutex.h +++ b/folly/SharedMutex.h @@ -563,7 +563,7 @@ class SharedMutexImpl { }; // 32 bits of state - Futex state_; + Futex state_{}; // S count needs to be on the end, because we explicitly allow it to // underflow. This can occur while we are in the middle of applying diff --git a/folly/SpinLock.h b/folly/SpinLock.h index 3df5d4e1..a735fcd1 100644 --- a/folly/SpinLock.h +++ b/folly/SpinLock.h @@ -34,6 +34,8 @@ #include +#include + #include #include diff --git a/folly/concurrency/DynamicBoundedQueue.h b/folly/concurrency/DynamicBoundedQueue.h index e6634b8d..18ff4928 100644 --- a/folly/concurrency/DynamicBoundedQueue.h +++ b/folly/concurrency/DynamicBoundedQueue.h @@ -330,7 +330,8 @@ class DynamicBoundedQueue { capacity_(capacity + threshold(capacity)), // capacity slack credit_(0), threshold_(threshold(capacity)), - transfer_(0) {} + transfer_(0), + waiting_(0) {} /** destructor */ ~DynamicBoundedQueue() {} diff --git a/folly/detail/Futex.h b/folly/detail/Futex.h index 630ad696..de0c78f9 100644 --- a/folly/detail/Futex.h +++ b/folly/detail/Futex.h @@ -22,8 +22,6 @@ #include #include -#include - #include namespace folly { namespace detail { @@ -45,9 +43,8 @@ enum class FutexResult { * (and benchmarks to back you up). */ template