mdbx: merge branch 'master' into devel.

Change-Id: Ib1d07cf6eb2e4c76b3be969b28bf2317cb326835
This commit is contained in:
Leonid Yuriev
2020-12-03 18:42:10 +03:00
4 changed files with 26 additions and 9 deletions

View File

@@ -1314,20 +1314,18 @@ txn_managed::~txn_managed() noexcept {
void txn_managed::abort() {
const error err = static_cast<MDBX_error_t>(::mdbx_txn_abort(handle_));
if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) {
if (err.code() != MDBX_THREAD_MISMATCH)
handle_ = nullptr;
if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH))
handle_ = nullptr;
if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS))
err.throw_exception();
}
}
void txn_managed::commit() {
const error err = static_cast<MDBX_error_t>(::mdbx_txn_commit(handle_));
if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS)) {
if (err.code() != MDBX_THREAD_MISMATCH)
handle_ = nullptr;
if (MDBX_LIKELY(err.code() != MDBX_THREAD_MISMATCH))
handle_ = nullptr;
if (MDBX_UNLIKELY(err.code() != MDBX_SUCCESS))
err.throw_exception();
}
}
//------------------------------------------------------------------------------