/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <atomic>
#include <boost/noncopyable.hpp>
-#include <iostream>
#include <cmath>
#include <memory>
#include <string.h>
#include <type_traits>
-#include <unistd.h>
-#include <folly/detail/TurnSequencer.h>
#include <folly/Portability.h>
+#include <folly/detail/TurnSequencer.h>
+#include <folly/portability/TypeTraits.h>
+#include <folly/portability/Unistd.h>
namespace folly {
namespace detail {
bool waitAndTryRead(T& dest, uint32_t turn) noexcept {
uint32_t desired_turn = (turn + 1) * 2;
Atom<uint32_t> cutoff(0);
- if(!sequencer_.tryWaitForTurn(desired_turn, cutoff, false)) {
+ if (sequencer_.tryWaitForTurn(desired_turn, cutoff, false) !=
+ TurnSequencer<Atom>::TryWaitResult::SUCCESS) {
return false;
}
memcpy(&dest, &data, sizeof(T));