summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_write_concern_defaults.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-01-20 10:03:08 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-15 11:19:48 +0000
commit611979eb5cafba7bb5369a19948f82453f117c65 (patch)
treefe04826f378fbd3b05d9f49173f6074726da5c00 /src/mongo/db/read_write_concern_defaults.h
parent44a107ad428459cad6260490ae98bca442e07385 (diff)
downloadmongo-611979eb5cafba7bb5369a19948f82453f117c65.tar.gz
SERVER-44978 Thread-through ServiceContext and ThreadPool to ReadThroughCache
There are no functional changes to this CR, it just instantiates every usage of ReadThroughCache with a ServiceContext and ThreadPool, which will be used for making the acquire method asynchronous.
Diffstat (limited to 'src/mongo/db/read_write_concern_defaults.h')
-rw-r--r--src/mongo/db/read_write_concern_defaults.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/read_write_concern_defaults.h b/src/mongo/db/read_write_concern_defaults.h
index d493fdf2cc3..259a3eafd24 100644
--- a/src/mongo/db/read_write_concern_defaults.h
+++ b/src/mongo/db/read_write_concern_defaults.h
@@ -37,6 +37,7 @@
#include "mongo/db/service_context.h"
#include "mongo/db/write_concern_options.h"
#include "mongo/platform/mutex.h"
+#include "mongo/util/concurrency/thread_pool.h"
#include "mongo/util/concurrency/with_lock.h"
#include "mongo/util/read_through_cache.h"
@@ -161,7 +162,7 @@ private:
Cache& operator=(const Cache&) = delete;
public:
- Cache(LookupFn lookupFn);
+ Cache(ThreadPoolInterface& threadPool, LookupFn lookupFn);
virtual ~Cache() = default;
boost::optional<RWConcernDefault> lookup(OperationContext* opCtx, const Type& key) override;
@@ -172,6 +173,9 @@ private:
LookupFn _lookupFn;
};
+ // Thread pool on which to perform loading of the cached RWC defaults
+ ThreadPool _threadPool;
+
Cache _defaults;
};