diff options
author | James Wahlin <james@mongodb.com> | 2020-03-06 15:33:37 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-09 13:35:51 +0000 |
commit | 8a9d5677f500293448311e6c551549b60cbfc780 (patch) | |
tree | 24abe32ca873be2453c4ac4d2c7cab38b27537ce /src/mongo/scripting/mozjs/implscope.cpp | |
parent | 340c085a7fd3e589442bce69db86d51cae1e82a6 (diff) | |
download | mongo-8a9d5677f500293448311e6c551549b60cbfc780.tar.gz |
SERVER-46227 MozJSImplScope::kill() check for "correct thread" will always fail
Diffstat (limited to 'src/mongo/scripting/mozjs/implscope.cpp')
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index 34729b87a33..f06a20bfc0a 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -136,6 +136,7 @@ void MozJSImplScope::registerOperation(OperationContext* opCtx) { _opCtx = opCtx; _opId = opCtx->getOpID(); + _opCtxThreadId = stdx::this_thread::get_id(); _engine->registerOperation(opCtx, this); } @@ -153,7 +154,7 @@ void MozJSImplScope::kill() { // If we are on the right thread, in the middle of an operation, and we have a registered // opCtx, then we should check the opCtx for interrupts. - if (_mr._thread.get_id() == stdx::this_thread::get_id() && _inOp > 0 && _opCtx) { + if (_opCtxThreadId == stdx::this_thread::get_id() && _inOp > 0 && _opCtx) { _killStatus = _opCtx->checkForInterruptNoAssert(); } |