summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-11-04 11:44:52 -0500
committerJason Rassi <rassi@10gen.com>2014-11-04 11:47:33 -0500
commit7849434abe5c8c24c7dd6dc7e664ebf1069c2557 (patch)
treef31b7da7541a436efae36f4c9f2ba87fd4644025 /src/mongo/db/query
parentf91d3efd69a154d46a73caf2e6b5a5f632b56061 (diff)
downloadmongo-7849434abe5c8c24c7dd6dc7e664ebf1069c2557.tar.gz
SERVER-15541 Clean up some usages of WriteUnitOfWork
Removes some WriteUnitOfWork objects where they are unneeded, and moves the declaration of some existing WriteUnitOfWork objects to limit their scope to the write being performed (so that yield-capable reads are not inside them).
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/plan_yield_policy.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mongo/db/query/plan_yield_policy.cpp b/src/mongo/db/query/plan_yield_policy.cpp
index 7aa624d6ee9..fdf909152cc 100644
--- a/src/mongo/db/query/plan_yield_policy.cpp
+++ b/src/mongo/db/query/plan_yield_policy.cpp
@@ -42,6 +42,7 @@ namespace mongo {
_planYielding(exec) { }
bool PlanYieldPolicy::shouldYield() {
+ invariant(!_planYielding->getOpCtx()->lockState()->inAWriteUnitOfWork());
return _elapsedTracker.intervalHasElapsed();
}