summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builder.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-05-27 19:36:59 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-06-05 14:21:56 -0400
commit51c2064d518140fbeae62f9d7ba29f1d69fb530f (patch)
treeb6d97eb91b4ac76279eb983234c6ec63ac44a8c6 /src/mongo/db/index_builder.cpp
parent1cf11a282870c26ce7d963fb3a6c3329b39d90a2 (diff)
downloadmongo-51c2064d518140fbeae62f9d7ba29f1d69fb530f.tar.gz
SERVER-18277 Stronger locking rules for CurOp and OpDebug.
Diffstat (limited to 'src/mongo/db/index_builder.cpp')
-rw-r--r--src/mongo/db/index_builder.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp
index 6d205c45da9..e5939343265 100644
--- a/src/mongo/db/index_builder.cpp
+++ b/src/mongo/db/index_builder.cpp
@@ -87,7 +87,10 @@ namespace {
AuthorizationSession::get(txn.getClient())->grantInternalAuthorization();
- CurOp::get(txn)->setOp(dbInsert);
+ {
+ stdx::lock_guard<Client> lk(*txn.getClient());
+ CurOp::get(txn)->setOp_inlock(dbInsert);
+ }
NamespaceString ns(_index["ns"].String());
ScopedTransaction transaction(&txn, MODE_IX);
@@ -141,8 +144,11 @@ namespace {
}
}
- // Show which index we're building in the curop display.
- CurOp::get(txn)->setQuery(_index);
+ {
+ stdx::lock_guard<Client> lk(*txn->getClient());
+ // Show which index we're building in the curop display.
+ CurOp::get(txn)->setQuery_inlock(_index);
+ }
bool haveSetBgIndexStarting = false;
while (true) {