diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-01-09 17:32:12 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-01-11 10:50:23 -0500 |
commit | bbf28648de0d8695c502e13922a8d9e5ca1b51e8 (patch) | |
tree | 6382810d03fb698d9b2d49f488be90e604324811 /src/mongo/scripting | |
parent | 17514947cc816df2500aa0e919506586d4d56aa0 (diff) | |
download | mongo-bbf28648de0d8695c502e13922a8d9e5ca1b51e8.tar.gz |
SERVER-30711: scope_guard rewrite, to avoid -Werror=noexcept-type
Macro ON_BLOCK_EXIT(...) now takes a single callable,
Some renames:
Dismias -> dismiss
MakeGuard => makeGuard
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/mozjs/implscope.cpp | 4 | ||||
-rw-r--r-- | src/mongo/scripting/mozjs/proxyscope.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/scripting/mozjs/implscope.cpp b/src/mongo/scripting/mozjs/implscope.cpp index 0f3859306fd..830d2df320a 100644 --- a/src/mongo/scripting/mozjs/implscope.cpp +++ b/src/mongo/scripting/mozjs/implscope.cpp @@ -130,7 +130,7 @@ void MozJSImplScope::_reportError(JSContext* cx, const char* message, JSErrorRep } scope->_inReportError = true; - const auto guard = MakeGuard([&] { scope->_inReportError = false; }); + const auto guard = makeGuard([&] { scope->_inReportError = false; }); if (!JSREPORT_IS_WARNING(report->flags)) { @@ -243,7 +243,7 @@ bool MozJSImplScope::_interruptCallback(JSContext* cx) { auto scope = getScope(cx); JS_SetInterruptCallback(scope->_runtime, nullptr); - auto guard = MakeGuard([&]() { JS_SetInterruptCallback(scope->_runtime, _interruptCallback); }); + auto guard = makeGuard([&]() { JS_SetInterruptCallback(scope->_runtime, _interruptCallback); }); if (scope->_pendingGC.load() || closeToMaxMemory()) { scope->_pendingGC.store(false); diff --git a/src/mongo/scripting/mozjs/proxyscope.cpp b/src/mongo/scripting/mozjs/proxyscope.cpp index d62eb913b97..8add7340d6a 100644 --- a/src/mongo/scripting/mozjs/proxyscope.cpp +++ b/src/mongo/scripting/mozjs/proxyscope.cpp @@ -344,7 +344,7 @@ void MozJSProxyScope::implThread(void* arg) { // This is mostly to silence coverity, so that it sees that the // ProxyScope doesn't hold a reference to the ImplScope after it // is deleted by the unique_ptr. - const auto unbindImplScope = MakeGuard([&proxy] { proxy->_implScope = nullptr; }); + const auto unbindImplScope = makeGuard([&proxy] { proxy->_implScope = nullptr; }); while (true) { stdx::unique_lock<stdx::mutex> lk(proxy->_mutex); |