summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context.h
diff options
context:
space:
mode:
authorJonathan Ma <jonathan.ma@mongodb.com>2019-01-23 09:50:36 -0500
committerJonathan Ma <jonathan.ma@mongodb.com>2019-01-24 13:49:22 -0500
commitaec398437d55ae1d88efd2439118dc8b978154e2 (patch)
tree48dcf8dc6a0d5a12fc656c95730c59d32da54d88 /src/mongo/db/service_context.h
parenta8b513ff6e2e3db87179fcb2f99499f19d47e8dc (diff)
downloadmongo-aec398437d55ae1d88efd2439118dc8b978154e2.tar.gz
SERVER-36663 Prevent killOperation from running without lock
Diffstat (limited to 'src/mongo/db/service_context.h')
-rw-r--r--src/mongo/db/service_context.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h
index e0014143da9..32091a06ca1 100644
--- a/src/mongo/db/service_context.h
+++ b/src/mongo/db/service_context.h
@@ -47,6 +47,7 @@
#include "mongo/transport/service_executor.h"
#include "mongo/transport/session.h"
#include "mongo/util/clock_source.h"
+#include "mongo/util/concurrency/with_lock.h"
#include "mongo/util/decorable.h"
#include "mongo/util/periodic_runner.h"
#include "mongo/util/tick_source.h"
@@ -355,10 +356,10 @@ public:
/**
* Kills the operation "opCtx" with the code "killCode", if opCtx has not already been killed.
* Caller must own the lock on opCtx->getClient, and opCtx->getServiceContext() must be the same
- *as
- * this service context.
+ * as this service context. WithLock expects that the client lock be passed in.
**/
- void killOperation(OperationContext* opCtx,
+ void killOperation(WithLock,
+ OperationContext* opCtx,
ErrorCodes::Error killCode = ErrorCodes::Interrupted);
/**