mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 03:04:12 +08:00
mdbx: don't check owner for finished transactions.
This commit is contained in:
parent
e444c70cb7
commit
06734bf8ff
10
src/core.c
10
src/core.c
@ -8152,13 +8152,17 @@ static __always_inline int check_txn(const MDBX_txn *txn, int bad_bits) {
|
||||
if (unlikely(txn->mt_flags & bad_bits))
|
||||
return MDBX_BAD_TXN;
|
||||
|
||||
mdbx_tassert(txn, (txn->mt_flags & MDBX_NOTLS) ==
|
||||
((txn->mt_flags & MDBX_TXN_RDONLY)
|
||||
? txn->mt_env->me_flags & MDBX_NOTLS
|
||||
: 0));
|
||||
#if MDBX_TXN_CHECKOWNER
|
||||
if ((txn->mt_flags & MDBX_NOTLS) == 0 &&
|
||||
unlikely(txn->mt_owner != mdbx_thread_self()))
|
||||
if (unlikely(txn->mt_owner != mdbx_thread_self()) &&
|
||||
(txn->mt_flags & (MDBX_NOTLS | MDBX_TXN_FINISHED)) == 0)
|
||||
return txn->mt_owner ? MDBX_THREAD_MISMATCH : MDBX_BAD_TXN;
|
||||
#endif /* MDBX_TXN_CHECKOWNER */
|
||||
|
||||
if (unlikely(!txn->mt_env->me_map))
|
||||
if (bad_bits && unlikely(!txn->mt_env->me_map))
|
||||
return MDBX_EPERM;
|
||||
|
||||
return MDBX_SUCCESS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user