From 77bea361da2080c0a596ac0cc640a37b84091488 Mon Sep 17 00:00:00 2001 From: James Sedgwick Date: Fri, 18 Sep 2015 15:24:53 -0700 Subject: [PATCH] move ThreadWheelTimekeeper out of detail Summary: This can be useful on its own, will use in twagent Reviewed By: @fugalh Differential Revision: D2457778 --- folly/Makefile.am | 4 ++-- folly/futures/Future.cpp | 2 +- folly/futures/{detail => }/ThreadWheelTimekeeper.cpp | 8 ++++++-- folly/futures/{detail => }/ThreadWheelTimekeeper.h | 6 ++---- 4 files changed, 11 insertions(+), 9 deletions(-) rename folly/futures/{detail => }/ThreadWheelTimekeeper.cpp (97%) rename folly/futures/{detail => }/ThreadWheelTimekeeper.h (94%) diff --git a/folly/Makefile.am b/folly/Makefile.am index 49c22ef6..2d90adde 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -148,13 +148,13 @@ nobase_follyinclude_HEADERS = \ futures/ScheduledExecutor.h \ futures/SharedPromise.h \ futures/SharedPromise-inl.h \ + futures/ThreadWheelTimekeeper.h \ futures/Timekeeper.h \ futures/Try-inl.h \ futures/Try.h \ futures/Unit.h \ futures/detail/Core.h \ futures/detail/FSM.h \ - futures/detail/ThreadWheelTimekeeper.h \ futures/detail/Types.h \ gen/Base.h \ gen/Base-inl.h \ @@ -317,13 +317,13 @@ libfolly_la_SOURCES = \ File.cpp \ FileUtil.cpp \ FingerprintTables.cpp \ - futures/detail/ThreadWheelTimekeeper.cpp \ futures/Barrier.cpp \ futures/ThreadedExecutor.cpp \ futures/Future.cpp \ futures/InlineExecutor.cpp \ futures/ManualExecutor.cpp \ futures/QueuedImmediateExecutor.cpp \ + futures/ThreadWheelTimekeeper.cpp \ detail/Futex.cpp \ GroupVarint.cpp \ GroupVarintTables.cpp \ diff --git a/folly/futures/Future.cpp b/folly/futures/Future.cpp index 501322a1..bbab4003 100644 --- a/folly/futures/Future.cpp +++ b/folly/futures/Future.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ #include -#include +#include #include namespace folly { diff --git a/folly/futures/detail/ThreadWheelTimekeeper.cpp b/folly/futures/ThreadWheelTimekeeper.cpp similarity index 97% rename from folly/futures/detail/ThreadWheelTimekeeper.cpp rename to folly/futures/ThreadWheelTimekeeper.cpp index cd10671b..e65f3dbb 100644 --- a/folly/futures/detail/ThreadWheelTimekeeper.cpp +++ b/folly/futures/ThreadWheelTimekeeper.cpp @@ -19,7 +19,7 @@ #include #include -namespace folly { namespace detail { +namespace folly { namespace { Singleton timekeeperSingleton_; @@ -90,8 +90,12 @@ Future ThreadWheelTimekeeper::after(Duration dur) { return f; } +namespace detail { + Timekeeper* getTimekeeperSingleton() { return timekeeperSingleton_.get(); } -}} // folly::detail +} // detail + +} // folly diff --git a/folly/futures/detail/ThreadWheelTimekeeper.h b/folly/futures/ThreadWheelTimekeeper.h similarity index 94% rename from folly/futures/detail/ThreadWheelTimekeeper.h rename to folly/futures/ThreadWheelTimekeeper.h index 9625de78..63cb23a2 100644 --- a/folly/futures/detail/ThreadWheelTimekeeper.h +++ b/folly/futures/ThreadWheelTimekeeper.h @@ -22,7 +22,7 @@ #include #include -namespace folly { namespace detail { +namespace folly { /// The default Timekeeper implementation which uses a HHWheelTimer on an /// EventBase in a dedicated thread. Users needn't deal with this directly, it @@ -45,6 +45,4 @@ class ThreadWheelTimekeeper : public Timekeeper { HHWheelTimer::UniquePtr wheelTimer_; }; -Timekeeper* getTimekeeperSingleton(); - -}} // folly::detail +} // folly -- 2.34.1