diff options
Diffstat (limited to 'src/mongo/transport/transport_layer_asio.h')
| -rw-r--r-- | src/mongo/transport/transport_layer_asio.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/transport/transport_layer_asio.h b/src/mongo/transport/transport_layer_asio.h index c0ecf4b9b80..e5a77fcb242 100644 --- a/src/mongo/transport/transport_layer_asio.h +++ b/src/mongo/transport/transport_layer_asio.h @@ -127,7 +127,12 @@ public: */ class TimerService { public: - TimerService(); + using Spawn = std::function<stdx::thread(std::function<void()>)>; + struct Options { + Spawn spawn; + }; + explicit TimerService(Options opt); + TimerService() : TimerService(Options{}) {} ~TimerService(); /** @@ -162,6 +167,7 @@ public: enum class State { kInitialized, kStarted, kStopped }; AtomicWord<State> _state; + Spawn _spawn = [](std::function<void()> f) { return stdx::thread{std::move(f)}; }; stdx::thread _thread; }; |
