};
// 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
#include <type_traits>
+#include <boost/noncopyable.hpp>
+
#include <folly/Portability.h>
#include <folly/SmallLocks.h>
capacity_(capacity + threshold(capacity)), // capacity slack
credit_(0),
threshold_(threshold(capacity)),
- transfer_(0) {}
+ transfer_(0),
+ waiting_(0) {}
/** destructor */
~DynamicBoundedQueue() {}
#include <limits>
#include <type_traits>
-#include <boost/noncopyable.hpp>
-
#include <folly/portability/Unistd.h>
namespace folly { namespace detail {
* (and benchmarks to back you up).
*/
template <template <typename> class Atom = std::atomic>
-struct Futex : Atom<uint32_t>, boost::noncopyable {
-
- explicit constexpr Futex(uint32_t init = 0) : Atom<uint32_t>(init) {}
+struct Futex : Atom<uint32_t> {
+ using Atom<uint32_t>::Atom;
/** Puts the thread to sleep if this->load() == expected. Returns true when
* it is returning because it has consumed a wake() event, false for any
private:
size_t maxSize_;
PriorityQueue pq_;
- detail::Futex<Atom> empty_;
- detail::Futex<Atom> full_;
+ detail::Futex<Atom> empty_{};
+ detail::Futex<Atom> full_{};
bool isTrue(detail::Futex<Atom>& futex) {
return futex.load(std::memory_order_relaxed) != 0;
union {
std::atomic<intptr_t> waitingFiber_;
struct {
- folly::detail::Futex<> futex;
+ folly::detail::Futex<> futex{};
int32_t _unused_packing;
} futex_;
};
class ThreadCachedInts {
std::atomic<int64_t> orphan_inc_[2];
std::atomic<int64_t> orphan_dec_[2];
- folly::detail::Futex<> waiting_;
+ folly::detail::Futex<> waiting_{0};
class Integer {
public: