summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_concern.cpp
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-11-07 15:22:08 +0000
committerevergreen <evergreen@mongodb.com>2019-11-07 15:22:08 +0000
commitb2493375543cb89b020f224a1759c1f4d40aa638 (patch)
tree971629049003126366f31846208ce6bf65fdbd20 /src/mongo/db/read_concern.cpp
parenta811bbe9d2489c428886288651c2dbddec0d123d (diff)
downloadmongo-b2493375543cb89b020f224a1759c1f4d40aa638.tar.gz
SERVER-44372 WeakFunction: a simplification of SHIM_ macros
Diffstat (limited to 'src/mongo/db/read_concern.cpp')
-rw-r--r--src/mongo/db/read_concern.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/mongo/db/read_concern.cpp b/src/mongo/db/read_concern.cpp
index 1ddbf1dcefc..07944dd56df 100644
--- a/src/mongo/db/read_concern.cpp
+++ b/src/mongo/db/read_concern.cpp
@@ -28,12 +28,34 @@
*/
#include "mongo/db/read_concern.h"
+#include "mongo/base/shim.h"
+#include "mongo/db/repl/speculative_majority_read_info.h"
namespace mongo {
-MONGO_DEFINE_SHIM(setPrepareConflictBehaviorForReadConcern);
-MONGO_DEFINE_SHIM(waitForReadConcern);
-MONGO_DEFINE_SHIM(waitForLinearizableReadConcern);
-MONGO_DEFINE_SHIM(waitForSpeculativeMajorityReadConcern);
+void setPrepareConflictBehaviorForReadConcern(OperationContext* opCtx,
+ const repl::ReadConcernArgs& readConcernArgs,
+ PrepareConflictBehavior prepareConflictBehavior) {
+ static auto w = MONGO_WEAK_FUNCTION_DEFINITION(setPrepareConflictBehaviorForReadConcern);
+ return w(opCtx, readConcernArgs, prepareConflictBehavior);
+}
+
+Status waitForReadConcern(OperationContext* opCtx,
+ const repl::ReadConcernArgs& readConcernArgs,
+ bool allowAfterClusterTime) {
+ static auto w = MONGO_WEAK_FUNCTION_DEFINITION(waitForReadConcern);
+ return w(opCtx, readConcernArgs, allowAfterClusterTime);
+}
+
+Status waitForLinearizableReadConcern(OperationContext* opCtx, int readConcernTimeout) {
+ static auto w = MONGO_WEAK_FUNCTION_DEFINITION(waitForLinearizableReadConcern);
+ return w(opCtx, readConcernTimeout);
+}
+
+Status waitForSpeculativeMajorityReadConcern(
+ OperationContext* opCtx, repl::SpeculativeMajorityReadInfo speculativeReadInfo) {
+ static auto w = MONGO_WEAK_FUNCTION_DEFINITION(waitForSpeculativeMajorityReadConcern);
+ return w(opCtx, speculativeReadInfo);
+}
} // namespace mongo