diff options
author | Benety Goh <benety@mongodb.com> | 2018-12-21 05:54:33 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-12-21 05:54:46 -0500 |
commit | bfddc5baaaa6cbbed435c7749cc740ecadd154f9 (patch) | |
tree | 119e8ea426ab242f763028ab6d3ff2aa6ddc9d9a | |
parent | 4270e87c62a2c7ea365b20bb37ede7e3888ad0ed (diff) | |
download | mongo-bfddc5baaaa6cbbed435c7749cc740ecadd154f9.tar.gz |
SERVER-37830 fix ReentrancyGuard
-rw-r--r-- | src/mongo/embedded/api_common.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/embedded/api_common.h b/src/mongo/embedded/api_common.h index a0be42d1a34..4070cef85b9 100644 --- a/src/mongo/embedded/api_common.h +++ b/src/mongo/embedded/api_common.h @@ -151,7 +151,7 @@ struct enterCXXImpl; template <typename Status, typename Function> struct enterCXXImpl<Status, Function, void> { template <typename Callable> - static int call(Callable&& function, Status& status, ReentrancyGuard = {}) noexcept { + static int call(Callable&& function, Status& status, const ReentrancyGuard& = {}) noexcept { try { function(); } catch (...) { @@ -165,7 +165,9 @@ struct enterCXXImpl<Status, Function, void> { template <typename Status, typename Function, typename Pointer> struct enterCXXImpl<Status, Function, Pointer*> { template <typename Callable> - static Pointer* call(Callable&& function, Status& status, ReentrancyGuard = {}) noexcept try { + static Pointer* call(Callable&& function, + Status& status, + const ReentrancyGuard& = {}) noexcept try { return function(); } catch (...) { return handleException(status); |