summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context.h
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-06-15 16:07:15 -0400
committerRandolph Tan <randolph@10gen.com>2015-06-17 15:27:45 -0400
commit63b4dff0e2496b610de26d160b9288314795ced0 (patch)
treeb2625d43b5caa3b4b45d3c71cb49d38fbf7f6ee7 /src/mongo/db/service_context.h
parente8dd921f644576193ffa6e7df65efbbf4a5a68f1 (diff)
downloadmongo-63b4dff0e2496b610de26d160b9288314795ced0.tar.gz
SERVER-18525 Mock out tick source in replset_dist_lock_manager_test
Diffstat (limited to 'src/mongo/db/service_context.h')
-rw-r--r--src/mongo/db/service_context.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h
index accd9232947..7cf48b9861f 100644
--- a/src/mongo/db/service_context.h
+++ b/src/mongo/db/service_context.h
@@ -36,6 +36,7 @@
#include "mongo/platform/unordered_set.h"
#include "mongo/stdx/functional.h"
#include "mongo/util/decorable.h"
+#include "mongo/util/tick_source.h"
namespace mongo {
@@ -303,6 +304,16 @@ namespace mongo {
*/
virtual OpObserver* getOpObserver() = 0;
+ /**
+ * Returns the tick source set in this context.
+ */
+ TickSource* getTickSource() const;
+
+ /**
+ * Replaces the current tick source with a new one.
+ */
+ void setTickSource(std::unique_ptr<TickSource> newSource);
+
protected:
ServiceContext() = default;
@@ -323,6 +334,8 @@ namespace mongo {
*/
std::vector<std::unique_ptr<ClientObserver>> _clientObservers;
ClientSet _clients;
+
+ std::unique_ptr<TickSource> _tickSource;
};
/**