mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx: корректировка txn_end()
для устранения лишних MDBX_TXN_OUSTED
.
This commit is contained in:
parent
7873118cdb
commit
9e3a36b74d
10
src/txn.c
10
src/txn.c
@ -1361,9 +1361,9 @@ int txn_end(MDBX_txn *txn, unsigned mode) {
|
||||
eASSERT(env, txn->txnid == slot->txnid.weak &&
|
||||
slot->txnid.weak >= env->lck->cached_oldest.weak);
|
||||
} else {
|
||||
if ((mode & TXN_END_OUSTED) == 0 &&
|
||||
if ((mode & TXN_END_OPMASK) != TXN_END_OUSTED &&
|
||||
safe64_read(&slot->tid) == MDBX_TID_TXN_OUSTED)
|
||||
mode += TXN_END_OUSTED;
|
||||
mode = (mode & TXN_END_OPMASK) | TXN_END_OUSTED;
|
||||
do {
|
||||
safe64_reset(&slot->txnid, false);
|
||||
atomic_store64(&slot->tid, txn->owner, mo_AcquireRelease);
|
||||
@ -1391,9 +1391,9 @@ int txn_end(MDBX_txn *txn, unsigned mode) {
|
||||
imports.srwl_ReleaseShared(&env->remap_guard);
|
||||
#endif
|
||||
txn->n_dbi = 0; /* prevent further DBI activity */
|
||||
txn->flags = (mode & TXN_END_OUSTED)
|
||||
? MDBX_TXN_RDONLY | MDBX_TXN_FINISHED | MDBX_TXN_OUSTED
|
||||
: MDBX_TXN_RDONLY | MDBX_TXN_FINISHED;
|
||||
txn->flags = ((mode & TXN_END_OPMASK) != TXN_END_OUSTED)
|
||||
? MDBX_TXN_RDONLY | MDBX_TXN_FINISHED
|
||||
: MDBX_TXN_RDONLY | MDBX_TXN_FINISHED | MDBX_TXN_OUSTED;
|
||||
txn->owner = 0;
|
||||
} else if (!(txn->flags & MDBX_TXN_FINISHED)) {
|
||||
ENSURE(env,
|
||||
|
Loading…
Reference in New Issue
Block a user