From b3dc093ef094d6d97c10755e60392124828c5103 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 5 Dec 2017 22:03:40 -0800 Subject: [PATCH] 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 --- CMakeLists.txt | 2 +- folly/Makefile.am | 2 +- folly/Singleton.h | 2 +- folly/executors/ThreadPoolExecutor.h | 2 +- .../executors/task_queue/test/UnboundedBlockingQueueTest.cpp | 2 +- folly/executors/test/ExecutorTest.cpp | 2 +- folly/executors/test/SerialExecutorTest.cpp | 2 +- folly/experimental/flat_combining/FlatCombining.h | 2 +- .../experimental/flat_combining/test/FlatCombiningExamples.h | 2 +- folly/experimental/observer/test/ObserverTest.cpp | 2 +- folly/experimental/test/FunctionSchedulerTest.cpp | 2 +- folly/experimental/test/ReadMostlySharedPtrTest.cpp | 2 +- folly/experimental/test/RefCountTest.cpp | 2 +- folly/fibers/GenericBaton.h | 2 +- folly/futures/Future-inl.h | 2 +- folly/futures/test/Benchmark.cpp | 2 +- folly/futures/test/FutureTest.cpp | 4 ++-- folly/futures/test/InterruptTest.cpp | 2 +- folly/futures/test/SemiFutureTest.cpp | 2 +- folly/futures/test/ViaTest.cpp | 2 +- folly/futures/test/WaitTest.cpp | 2 +- folly/io/async/EventBase.cpp | 2 +- folly/io/async/ScopedEventBaseThread.h | 2 +- folly/io/async/VirtualEventBase.h | 2 +- folly/io/async/test/EventBaseThreadTest.cpp | 2 +- folly/io/async/test/NotificationQueueTest.cpp | 2 +- folly/io/async/test/ScopedEventBaseThreadTest.cpp | 2 +- folly/{ => synchronization}/Baton.h | 0 folly/synchronization/LifoSem.h | 2 +- folly/{ => synchronization}/test/BatonBenchmark.cpp | 4 ++-- folly/{ => synchronization}/test/BatonTest.cpp | 4 ++-- folly/{ => synchronization}/test/BatonTestHelpers.h | 2 +- folly/system/test/ThreadNameTest.cpp | 2 +- folly/test/MemoryIdlerTest.cpp | 2 +- folly/test/ThreadLocalTest.cpp | 2 +- 35 files changed, 37 insertions(+), 37 deletions(-) rename folly/{ => synchronization}/Baton.h (100%) rename folly/{ => synchronization}/test/BatonBenchmark.cpp (96%) rename folly/{ => synchronization}/test/BatonTest.cpp (98%) rename folly/{ => synchronization}/test/BatonTestHelpers.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac34e7d4..fc0084dc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -537,6 +537,7 @@ if (BUILD_TESTS) TEST timeseries_test SOURCES TimeseriesTest.cpp DIRECTORY synchronization/test/ + TEST baton_test SOURCES BatonTest.cpp TEST call_once_test SOURCES CallOnceTest.cpp TEST lifo_sem_test SOURCES LifoSemTests.cpp @@ -558,7 +559,6 @@ if (BUILD_TESTS) TEST atomic_linked_list_test SOURCES AtomicLinkedListTest.cpp TEST atomic_struct_test SOURCES AtomicStructTest.cpp TEST atomic_unordered_map_test SOURCES AtomicUnorderedMapTest.cpp - TEST baton_test SOURCES BatonTest.cpp TEST bit_iterator_test SOURCES BitIteratorTest.cpp TEST bits_test SOURCES BitsTest.cpp TEST cacheline_padded_test SOURCES CachelinePaddedTest.cpp diff --git a/folly/Makefile.am b/folly/Makefile.am index 4ca4388d..98547554 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -37,7 +37,6 @@ nobase_follyinclude_HEADERS = \ AtomicLinkedList.h \ AtomicStruct.h \ AtomicUnorderedMap.h \ - Baton.h \ Benchmark.h \ Bits.h \ CachelinePadded.h \ @@ -433,6 +432,7 @@ nobase_follyinclude_HEADERS = \ stats/TimeseriesHistogram-defs.h \ stats/TimeseriesHistogram.h \ synchronization/AsymmetricMemoryBarrier.h \ + synchronization/Baton.h \ synchronization/CallOnce.h \ synchronization/LifoSem.h \ synchronization/detail/AtomicUtils.h \ diff --git a/folly/Singleton.h b/folly/Singleton.h index 01a9d5d1..48251b66 100644 --- a/folly/Singleton.h +++ b/folly/Singleton.h @@ -121,7 +121,6 @@ // should call reenableInstances. #pragma once -#include #include #include #include @@ -131,6 +130,7 @@ #include #include #include +#include #include #include diff --git a/folly/executors/ThreadPoolExecutor.h b/folly/executors/ThreadPoolExecutor.h index a92726ef..0e5bcc17 100644 --- a/folly/executors/ThreadPoolExecutor.h +++ b/folly/executors/ThreadPoolExecutor.h @@ -15,7 +15,6 @@ */ #pragma once -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/folly/executors/task_queue/test/UnboundedBlockingQueueTest.cpp b/folly/executors/task_queue/test/UnboundedBlockingQueueTest.cpp index a7b1efd5..c3e7d0d4 100644 --- a/folly/executors/task_queue/test/UnboundedBlockingQueueTest.cpp +++ b/folly/executors/task_queue/test/UnboundedBlockingQueueTest.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ #include -#include #include +#include #include using namespace folly; diff --git a/folly/executors/test/ExecutorTest.cpp b/folly/executors/test/ExecutorTest.cpp index 2bbc56a1..e017ca78 100644 --- a/folly/executors/test/ExecutorTest.cpp +++ b/folly/executors/test/ExecutorTest.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include #include #include #include #include #include +#include // TODO(jsedgwick) move this test to executors/test/ once the tested executors // have all moved diff --git a/folly/executors/test/SerialExecutorTest.cpp b/folly/executors/test/SerialExecutorTest.cpp index ae487591..5e022a1f 100644 --- a/folly/executors/test/SerialExecutorTest.cpp +++ b/folly/executors/test/SerialExecutorTest.cpp @@ -16,11 +16,11 @@ #include -#include #include #include #include #include +#include using namespace std::chrono; using folly::SerialExecutor; diff --git a/folly/experimental/flat_combining/FlatCombining.h b/folly/experimental/flat_combining/FlatCombining.h index 63fe1ce7..235e24b2 100644 --- a/folly/experimental/flat_combining/FlatCombining.h +++ b/folly/experimental/flat_combining/FlatCombining.h @@ -16,11 +16,11 @@ #pragma once -#include #include #include #include #include +#include #include #include diff --git a/folly/experimental/flat_combining/test/FlatCombiningExamples.h b/folly/experimental/flat_combining/test/FlatCombiningExamples.h index 4736dfa8..fe6ab184 100644 --- a/folly/experimental/flat_combining/test/FlatCombiningExamples.h +++ b/folly/experimental/flat_combining/test/FlatCombiningExamples.h @@ -20,8 +20,8 @@ #include #include -#include #include +#include namespace folly { diff --git a/folly/experimental/observer/test/ObserverTest.cpp b/folly/experimental/observer/test/ObserverTest.cpp index ed372f5a..1c3bb28f 100644 --- a/folly/experimental/observer/test/ObserverTest.cpp +++ b/folly/experimental/observer/test/ObserverTest.cpp @@ -16,9 +16,9 @@ #include -#include #include #include +#include using namespace folly::observer; diff --git a/folly/experimental/test/FunctionSchedulerTest.cpp b/folly/experimental/test/FunctionSchedulerTest.cpp index ec943958..b869f2a8 100644 --- a/folly/experimental/test/FunctionSchedulerTest.cpp +++ b/folly/experimental/test/FunctionSchedulerTest.cpp @@ -21,10 +21,10 @@ #include -#include #include #include #include +#include #if defined(__linux__) #include diff --git a/folly/experimental/test/ReadMostlySharedPtrTest.cpp b/folly/experimental/test/ReadMostlySharedPtrTest.cpp index 08996115..789eeecd 100644 --- a/folly/experimental/test/ReadMostlySharedPtrTest.cpp +++ b/folly/experimental/test/ReadMostlySharedPtrTest.cpp @@ -20,11 +20,11 @@ #include #include -#include #include #include #include #include +#include using folly::ReadMostlyMainPtr; using folly::ReadMostlyWeakPtr; diff --git a/folly/experimental/test/RefCountTest.cpp b/folly/experimental/test/RefCountTest.cpp index a63de14d..3c75ae3c 100644 --- a/folly/experimental/test/RefCountTest.cpp +++ b/folly/experimental/test/RefCountTest.cpp @@ -15,10 +15,10 @@ */ #include -#include #include #include #include +#include namespace folly { diff --git a/folly/fibers/GenericBaton.h b/folly/fibers/GenericBaton.h index 93dbebae..6cab1bf0 100644 --- a/folly/fibers/GenericBaton.h +++ b/folly/fibers/GenericBaton.h @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 5818244c..be53ff7c 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -21,11 +21,11 @@ #include #include -#include #include #include #include #include +#include #ifndef FOLLY_FUTURE_USING_FIBER #if FOLLY_MOBILE || defined(__APPLE__) diff --git a/folly/futures/test/Benchmark.cpp b/folly/futures/test/Benchmark.cpp index a9c743de..336ce7f7 100644 --- a/folly/futures/test/Benchmark.cpp +++ b/folly/futures/test/Benchmark.cpp @@ -15,12 +15,12 @@ */ #include -#include #include #include #include #include #include +#include #include diff --git a/folly/futures/test/FutureTest.cpp b/folly/futures/test/FutureTest.cpp index e269aa15..ae321fde 100644 --- a/folly/futures/test/FutureTest.cpp +++ b/folly/futures/test/FutureTest.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include +#include #include #include #include #include -#include #include +#include #include #include diff --git a/folly/futures/test/InterruptTest.cpp b/folly/futures/test/InterruptTest.cpp index 7c51bb1e..fc87606b 100644 --- a/folly/futures/test/InterruptTest.cpp +++ b/folly/futures/test/InterruptTest.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include #include #include #include +#include using namespace folly; diff --git a/folly/futures/test/SemiFutureTest.cpp b/folly/futures/test/SemiFutureTest.cpp index 39ea108b..7b927021 100644 --- a/folly/futures/test/SemiFutureTest.cpp +++ b/folly/futures/test/SemiFutureTest.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include #include @@ -22,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/folly/futures/test/ViaTest.cpp b/folly/futures/test/ViaTest.cpp index fb2008a8..f7a81c99 100644 --- a/folly/futures/test/ViaTest.cpp +++ b/folly/futures/test/ViaTest.cpp @@ -16,13 +16,13 @@ #include -#include #include #include #include #include #include #include +#include using namespace folly; diff --git a/folly/futures/test/WaitTest.cpp b/folly/futures/test/WaitTest.cpp index 57e4e172..1d1b287d 100644 --- a/folly/futures/test/WaitTest.cpp +++ b/folly/futures/test/WaitTest.cpp @@ -16,10 +16,10 @@ #include -#include #include #include #include +#include using namespace folly; using std::vector; diff --git a/folly/io/async/EventBase.cpp b/folly/io/async/EventBase.cpp index c1ed7336..1466d721 100644 --- a/folly/io/async/EventBase.cpp +++ b/folly/io/async/EventBase.cpp @@ -26,11 +26,11 @@ #include #include -#include #include #include #include #include +#include #include namespace folly { diff --git a/folly/io/async/ScopedEventBaseThread.h b/folly/io/async/ScopedEventBaseThread.h index c81ab393..c234dc00 100644 --- a/folly/io/async/ScopedEventBaseThread.h +++ b/folly/io/async/ScopedEventBaseThread.h @@ -19,8 +19,8 @@ #include #include -#include #include +#include namespace folly { diff --git a/folly/io/async/VirtualEventBase.h b/folly/io/async/VirtualEventBase.h index 5120f21e..30e8404b 100644 --- a/folly/io/async/VirtualEventBase.h +++ b/folly/io/async/VirtualEventBase.h @@ -18,9 +18,9 @@ #include -#include #include #include +#include namespace folly { diff --git a/folly/io/async/test/EventBaseThreadTest.cpp b/folly/io/async/test/EventBaseThreadTest.cpp index e804501e..88ed75b2 100644 --- a/folly/io/async/test/EventBaseThreadTest.cpp +++ b/folly/io/async/test/EventBaseThreadTest.cpp @@ -18,9 +18,9 @@ #include -#include #include #include +#include #include using namespace std; diff --git a/folly/io/async/test/NotificationQueueTest.cpp b/folly/io/async/test/NotificationQueueTest.cpp index 727eaad2..2ff48d54 100644 --- a/folly/io/async/test/NotificationQueueTest.cpp +++ b/folly/io/async/test/NotificationQueueTest.cpp @@ -22,9 +22,9 @@ #include #include -#include #include #include +#include #ifndef _WIN32 #include diff --git a/folly/io/async/test/ScopedEventBaseThreadTest.cpp b/folly/io/async/test/ScopedEventBaseThreadTest.cpp index 6f1d2266..321a0888 100644 --- a/folly/io/async/test/ScopedEventBaseThreadTest.cpp +++ b/folly/io/async/test/ScopedEventBaseThreadTest.cpp @@ -19,10 +19,10 @@ #include #include -#include #include #include #include +#include #include using namespace std; diff --git a/folly/Baton.h b/folly/synchronization/Baton.h similarity index 100% rename from folly/Baton.h rename to folly/synchronization/Baton.h diff --git a/folly/synchronization/LifoSem.h b/folly/synchronization/LifoSem.h index 90176094..ef27df4e 100644 --- a/folly/synchronization/LifoSem.h +++ b/folly/synchronization/LifoSem.h @@ -24,10 +24,10 @@ #include #include -#include #include #include #include +#include namespace folly { diff --git a/folly/test/BatonBenchmark.cpp b/folly/synchronization/test/BatonBenchmark.cpp similarity index 96% rename from folly/test/BatonBenchmark.cpp rename to folly/synchronization/test/BatonBenchmark.cpp index 82e3b5e3..25126282 100644 --- a/folly/test/BatonBenchmark.cpp +++ b/folly/synchronization/test/BatonBenchmark.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include using namespace folly; diff --git a/folly/test/BatonTest.cpp b/folly/synchronization/test/BatonTest.cpp similarity index 98% rename from folly/test/BatonTest.cpp rename to folly/synchronization/test/BatonTest.cpp index ded7fb50..2e6f5164 100644 --- a/folly/test/BatonTest.cpp +++ b/folly/synchronization/test/BatonTest.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include +#include #include #include -#include +#include #include using namespace folly; diff --git a/folly/test/BatonTestHelpers.h b/folly/synchronization/test/BatonTestHelpers.h similarity index 99% rename from folly/test/BatonTestHelpers.h rename to folly/synchronization/test/BatonTestHelpers.h index 3a48a215..6e242e2a 100644 --- a/folly/test/BatonTestHelpers.h +++ b/folly/synchronization/test/BatonTestHelpers.h @@ -16,8 +16,8 @@ #pragma once -#include #include +#include #include namespace folly { diff --git a/folly/system/test/ThreadNameTest.cpp b/folly/system/test/ThreadNameTest.cpp index 9dce6bd9..c4150247 100644 --- a/folly/system/test/ThreadNameTest.cpp +++ b/folly/system/test/ThreadNameTest.cpp @@ -16,9 +16,9 @@ #include -#include #include #include +#include #include using namespace std; diff --git a/folly/test/MemoryIdlerTest.cpp b/folly/test/MemoryIdlerTest.cpp index 72546f41..d5393115 100644 --- a/folly/test/MemoryIdlerTest.cpp +++ b/folly/test/MemoryIdlerTest.cpp @@ -16,9 +16,9 @@ #include -#include #include #include +#include #include #include diff --git a/folly/test/ThreadLocalTest.cpp b/folly/test/ThreadLocalTest.cpp index 6791c0f4..e724b999 100644 --- a/folly/test/ThreadLocalTest.cpp +++ b/folly/test/ThreadLocalTest.cpp @@ -37,11 +37,11 @@ #include -#include #include #include #include #include +#include #include using namespace folly; -- 2.34.1