Commit 77bea361 authored by James Sedgwick's avatar James Sedgwick Committed by facebook-github-bot-4

move ThreadWheelTimekeeper out of detail

Summary: This can be useful on its own, will use in twagent

Reviewed By: @fugalh

Differential Revision: D2457778
parent 4401039f
...@@ -148,13 +148,13 @@ nobase_follyinclude_HEADERS = \ ...@@ -148,13 +148,13 @@ nobase_follyinclude_HEADERS = \
futures/ScheduledExecutor.h \ futures/ScheduledExecutor.h \
futures/SharedPromise.h \ futures/SharedPromise.h \
futures/SharedPromise-inl.h \ futures/SharedPromise-inl.h \
futures/ThreadWheelTimekeeper.h \
futures/Timekeeper.h \ futures/Timekeeper.h \
futures/Try-inl.h \ futures/Try-inl.h \
futures/Try.h \ futures/Try.h \
futures/Unit.h \ futures/Unit.h \
futures/detail/Core.h \ futures/detail/Core.h \
futures/detail/FSM.h \ futures/detail/FSM.h \
futures/detail/ThreadWheelTimekeeper.h \
futures/detail/Types.h \ futures/detail/Types.h \
gen/Base.h \ gen/Base.h \
gen/Base-inl.h \ gen/Base-inl.h \
...@@ -317,13 +317,13 @@ libfolly_la_SOURCES = \ ...@@ -317,13 +317,13 @@ libfolly_la_SOURCES = \
File.cpp \ File.cpp \
FileUtil.cpp \ FileUtil.cpp \
FingerprintTables.cpp \ FingerprintTables.cpp \
futures/detail/ThreadWheelTimekeeper.cpp \
futures/Barrier.cpp \ futures/Barrier.cpp \
futures/ThreadedExecutor.cpp \ futures/ThreadedExecutor.cpp \
futures/Future.cpp \ futures/Future.cpp \
futures/InlineExecutor.cpp \ futures/InlineExecutor.cpp \
futures/ManualExecutor.cpp \ futures/ManualExecutor.cpp \
futures/QueuedImmediateExecutor.cpp \ futures/QueuedImmediateExecutor.cpp \
futures/ThreadWheelTimekeeper.cpp \
detail/Futex.cpp \ detail/Futex.cpp \
GroupVarint.cpp \ GroupVarint.cpp \
GroupVarintTables.cpp \ GroupVarintTables.cpp \
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <folly/futures/detail/ThreadWheelTimekeeper.h> #include <folly/futures/ThreadWheelTimekeeper.h>
#include <folly/Likely.h> #include <folly/Likely.h>
namespace folly { namespace folly {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <folly/futures/Future.h> #include <folly/futures/Future.h>
#include <future> #include <future>
namespace folly { namespace detail { namespace folly {
namespace { namespace {
Singleton<ThreadWheelTimekeeper> timekeeperSingleton_; Singleton<ThreadWheelTimekeeper> timekeeperSingleton_;
...@@ -90,8 +90,12 @@ Future<Unit> ThreadWheelTimekeeper::after(Duration dur) { ...@@ -90,8 +90,12 @@ Future<Unit> ThreadWheelTimekeeper::after(Duration dur) {
return f; return f;
} }
namespace detail {
Timekeeper* getTimekeeperSingleton() { Timekeeper* getTimekeeperSingleton() {
return timekeeperSingleton_.get(); return timekeeperSingleton_.get();
} }
}} // folly::detail } // detail
} // folly
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <folly/io/async/HHWheelTimer.h> #include <folly/io/async/HHWheelTimer.h>
#include <thread> #include <thread>
namespace folly { namespace detail { namespace folly {
/// The default Timekeeper implementation which uses a HHWheelTimer on an /// The default Timekeeper implementation which uses a HHWheelTimer on an
/// EventBase in a dedicated thread. Users needn't deal with this directly, it /// EventBase in a dedicated thread. Users needn't deal with this directly, it
...@@ -45,6 +45,4 @@ class ThreadWheelTimekeeper : public Timekeeper { ...@@ -45,6 +45,4 @@ class ThreadWheelTimekeeper : public Timekeeper {
HHWheelTimer::UniquePtr wheelTimer_; HHWheelTimer::UniquePtr wheelTimer_;
}; };
Timekeeper* getTimekeeperSingleton(); } // folly
}} // folly::detail
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