Commit b3dc093e authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Move folly/Baton.h to folly/synchronization/

Summary: [Folly] Move `folly/Baton.h` to `folly/synchronization/`.

Reviewed By: phoad, Orvid

Differential Revision: D6490282

fbshipit-source-id: 66e2d25ffe3275d576b97b81c1987709000f6649
parent af89b48f
...@@ -537,6 +537,7 @@ if (BUILD_TESTS) ...@@ -537,6 +537,7 @@ if (BUILD_TESTS)
TEST timeseries_test SOURCES TimeseriesTest.cpp TEST timeseries_test SOURCES TimeseriesTest.cpp
DIRECTORY synchronization/test/ DIRECTORY synchronization/test/
TEST baton_test SOURCES BatonTest.cpp
TEST call_once_test SOURCES CallOnceTest.cpp TEST call_once_test SOURCES CallOnceTest.cpp
TEST lifo_sem_test SOURCES LifoSemTests.cpp TEST lifo_sem_test SOURCES LifoSemTests.cpp
...@@ -558,7 +559,6 @@ if (BUILD_TESTS) ...@@ -558,7 +559,6 @@ if (BUILD_TESTS)
TEST atomic_linked_list_test SOURCES AtomicLinkedListTest.cpp TEST atomic_linked_list_test SOURCES AtomicLinkedListTest.cpp
TEST atomic_struct_test SOURCES AtomicStructTest.cpp TEST atomic_struct_test SOURCES AtomicStructTest.cpp
TEST atomic_unordered_map_test SOURCES AtomicUnorderedMapTest.cpp TEST atomic_unordered_map_test SOURCES AtomicUnorderedMapTest.cpp
TEST baton_test SOURCES BatonTest.cpp
TEST bit_iterator_test SOURCES BitIteratorTest.cpp TEST bit_iterator_test SOURCES BitIteratorTest.cpp
TEST bits_test SOURCES BitsTest.cpp TEST bits_test SOURCES BitsTest.cpp
TEST cacheline_padded_test SOURCES CachelinePaddedTest.cpp TEST cacheline_padded_test SOURCES CachelinePaddedTest.cpp
......
...@@ -37,7 +37,6 @@ nobase_follyinclude_HEADERS = \ ...@@ -37,7 +37,6 @@ nobase_follyinclude_HEADERS = \
AtomicLinkedList.h \ AtomicLinkedList.h \
AtomicStruct.h \ AtomicStruct.h \
AtomicUnorderedMap.h \ AtomicUnorderedMap.h \
Baton.h \
Benchmark.h \ Benchmark.h \
Bits.h \ Bits.h \
CachelinePadded.h \ CachelinePadded.h \
...@@ -433,6 +432,7 @@ nobase_follyinclude_HEADERS = \ ...@@ -433,6 +432,7 @@ nobase_follyinclude_HEADERS = \
stats/TimeseriesHistogram-defs.h \ stats/TimeseriesHistogram-defs.h \
stats/TimeseriesHistogram.h \ stats/TimeseriesHistogram.h \
synchronization/AsymmetricMemoryBarrier.h \ synchronization/AsymmetricMemoryBarrier.h \
synchronization/Baton.h \
synchronization/CallOnce.h \ synchronization/CallOnce.h \
synchronization/LifoSem.h \ synchronization/LifoSem.h \
synchronization/detail/AtomicUtils.h \ synchronization/detail/AtomicUtils.h \
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
// should call reenableInstances. // should call reenableInstances.
#pragma once #pragma once
#include <folly/Baton.h>
#include <folly/Demangle.h> #include <folly/Demangle.h>
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/Executor.h> #include <folly/Executor.h>
...@@ -131,6 +130,7 @@ ...@@ -131,6 +130,7 @@
#include <folly/detail/StaticSingletonManager.h> #include <folly/detail/StaticSingletonManager.h>
#include <folly/experimental/ReadMostlySharedPtr.h> #include <folly/experimental/ReadMostlySharedPtr.h>
#include <folly/hash/Hash.h> #include <folly/hash/Hash.h>
#include <folly/synchronization/Baton.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
#pragma once #pragma once
#include <folly/Baton.h>
#include <folly/Executor.h> #include <folly/Executor.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/RWSpinLock.h> #include <folly/RWSpinLock.h>
...@@ -23,6 +22,7 @@ ...@@ -23,6 +22,7 @@
#include <folly/executors/task_queue/LifoSemMPMCQueue.h> #include <folly/executors/task_queue/LifoSemMPMCQueue.h>
#include <folly/executors/thread_factory/NamedThreadFactory.h> #include <folly/executors/thread_factory/NamedThreadFactory.h>
#include <folly/io/async/Request.h> #include <folly/io/async/Request.h>
#include <folly/synchronization/Baton.h>
#include <algorithm> #include <algorithm>
#include <mutex> #include <mutex>
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/executors/task_queue/UnboundedBlockingQueue.h> #include <folly/executors/task_queue/UnboundedBlockingQueue.h>
#include <folly/Baton.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <thread> #include <thread>
using namespace folly; using namespace folly;
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h>
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/executors/QueuedImmediateExecutor.h> #include <folly/executors/QueuedImmediateExecutor.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
// TODO(jsedgwick) move this test to executors/test/ once the tested executors // TODO(jsedgwick) move this test to executors/test/ once the tested executors
// have all moved // have all moved
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include <chrono> #include <chrono>
#include <folly/Baton.h>
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/executors/SerialExecutor.h> #include <folly/executors/SerialExecutor.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using namespace std::chrono; using namespace std::chrono;
using folly::SerialExecutor; using folly::SerialExecutor;
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#pragma once #pragma once
#include <folly/Baton.h>
#include <folly/Function.h> #include <folly/Function.h>
#include <folly/IndexedMemPool.h> #include <folly/IndexedMemPool.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/concurrency/CacheLocality.h> #include <folly/concurrency/CacheLocality.h>
#include <folly/synchronization/Baton.h>
#include <atomic> #include <atomic>
#include <cassert> #include <cassert>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <folly/Baton.h>
#include <folly/experimental/flat_combining/FlatCombining.h> #include <folly/experimental/flat_combining/FlatCombining.h>
#include <folly/synchronization/Baton.h>
namespace folly { namespace folly {
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/experimental/observer/SimpleObservable.h> #include <folly/experimental/observer/SimpleObservable.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using namespace folly::observer; using namespace folly::observer;
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <folly/Baton.h>
#include <folly/Random.h> #include <folly/Random.h>
#include <folly/experimental/FunctionScheduler.h> #include <folly/experimental/FunctionScheduler.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#if defined(__linux__) #if defined(__linux__)
#include <dlfcn.h> #include <dlfcn.h>
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/experimental/RCURefCount.h> #include <folly/experimental/RCURefCount.h>
#include <folly/experimental/ReadMostlySharedPtr.h> #include <folly/experimental/ReadMostlySharedPtr.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using folly::ReadMostlyMainPtr; using folly::ReadMostlyMainPtr;
using folly::ReadMostlyWeakPtr; using folly::ReadMostlyWeakPtr;
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
*/ */
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/experimental/RCURefCount.h> #include <folly/experimental/RCURefCount.h>
#include <folly/experimental/TLRefCount.h> #include <folly/experimental/TLRefCount.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
namespace folly { namespace folly {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
#pragma once #pragma once
#include <folly/Baton.h> #include <folly/synchronization/Baton.h>
#include <folly/fibers/Baton.h> #include <folly/fibers/Baton.h>
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/futures/Timekeeper.h> #include <folly/futures/Timekeeper.h>
#include <folly/futures/detail/Core.h> #include <folly/futures/detail/Core.h>
#include <folly/synchronization/Baton.h>
#ifndef FOLLY_FUTURE_USING_FIBER #ifndef FOLLY_FUTURE_USING_FIBER
#if FOLLY_MOBILE || defined(__APPLE__) #if FOLLY_MOBILE || defined(__APPLE__)
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
*/ */
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/Baton.h>
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/futures/Promise.h> #include <folly/futures/Promise.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/Semaphore.h> #include <folly/portability/Semaphore.h>
#include <folly/synchronization/Baton.h>
#include <vector> #include <vector>
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h> #include <folly/futures/Future.h>
#include <folly/Executor.h> #include <folly/Executor.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/Unit.h> #include <folly/Unit.h>
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/futures/Future.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/futures/Promise.h> #include <folly/futures/Promise.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using namespace folly; using namespace folly;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h>
#include <folly/Executor.h> #include <folly/Executor.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/Unit.h> #include <folly/Unit.h>
...@@ -22,6 +21,7 @@ ...@@ -22,6 +21,7 @@
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/io/async/EventBase.h> #include <folly/io/async/EventBase.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/MPMCQueue.h> #include <folly/MPMCQueue.h>
#include <folly/executors/DrivableExecutor.h> #include <folly/executors/DrivableExecutor.h>
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using namespace folly; using namespace folly;
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#include <queue> #include <queue>
#include <folly/Baton.h>
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/io/async/EventBase.h> #include <folly/io/async/EventBase.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
using namespace folly; using namespace folly;
using std::vector; using std::vector;
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/io/async/NotificationQueue.h> #include <folly/io/async/NotificationQueue.h>
#include <folly/io/async/VirtualEventBase.h> #include <folly/io/async/VirtualEventBase.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
#include <folly/synchronization/Baton.h>
#include <folly/system/ThreadName.h> #include <folly/system/ThreadName.h>
namespace folly { namespace folly {
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <memory> #include <memory>
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/io/async/EventBase.h> #include <folly/io/async/EventBase.h>
#include <folly/synchronization/Baton.h>
namespace folly { namespace folly {
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include <future> #include <future>
#include <folly/Baton.h>
#include <folly/Executor.h> #include <folly/Executor.h>
#include <folly/io/async/EventBase.h> #include <folly/io/async/EventBase.h>
#include <folly/synchronization/Baton.h>
namespace folly { namespace folly {
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include <chrono> #include <chrono>
#include <folly/Baton.h>
#include <folly/io/async/EventBaseManager.h> #include <folly/io/async/EventBaseManager.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <folly/system/ThreadName.h> #include <folly/system/ThreadName.h>
using namespace std; using namespace std;
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#include <list> #include <list>
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/io/async/ScopedEventBaseThread.h> #include <folly/io/async/ScopedEventBaseThread.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#ifndef _WIN32 #ifndef _WIN32
#include <sys/wait.h> #include <sys/wait.h>
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
#include <chrono> #include <chrono>
#include <string> #include <string>
#include <folly/Baton.h>
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/io/async/EventBaseManager.h> #include <folly/io/async/EventBaseManager.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <folly/system/ThreadName.h> #include <folly/system/ThreadName.h>
using namespace std; using namespace std;
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include <system_error> #include <system_error>
#include <folly/AtomicStruct.h> #include <folly/AtomicStruct.h>
#include <folly/Baton.h>
#include <folly/CachelinePadded.h> #include <folly/CachelinePadded.h>
#include <folly/IndexedMemPool.h> #include <folly/IndexedMemPool.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/synchronization/Baton.h>
namespace folly { namespace folly {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h> #include <folly/synchronization/Baton.h>
#include <thread> #include <thread>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h> #include <folly/portability/Semaphore.h>
#include <folly/test/BatonTestHelpers.h> #include <folly/synchronization/test/BatonTestHelpers.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
using namespace folly; using namespace folly;
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Baton.h> #include <folly/synchronization/Baton.h>
#include <thread> #include <thread>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/test/BatonTestHelpers.h> #include <folly/synchronization/test/BatonTestHelpers.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
using namespace folly; using namespace folly;
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#pragma once #pragma once
#include <folly/Baton.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
namespace folly { namespace folly {
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include <thread> #include <thread>
#include <folly/Baton.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <folly/system/ThreadName.h> #include <folly/system/ThreadName.h>
using namespace std; using namespace std;
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#include <folly/detail/MemoryIdler.h> #include <folly/detail/MemoryIdler.h>
#include <folly/Baton.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <memory> #include <memory>
#include <thread> #include <thread>
......
...@@ -37,11 +37,11 @@ ...@@ -37,11 +37,11 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/Baton.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/experimental/io/FsUtil.h> #include <folly/experimental/io/FsUtil.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
#include <folly/synchronization/Baton.h>
#include <folly/system/ThreadId.h> #include <folly/system/ThreadId.h>
using namespace folly; using namespace folly;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment