mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:24:12 +08:00
mdbx: fix without-LCK (exclusive + readonly) mode.
This commit is contained in:
parent
f6db64bea1
commit
e795fe7c3e
20
src/core.c
20
src/core.c
@ -20144,15 +20144,17 @@ __cold static int fetch_envinfo_ex(const MDBX_env *env, const MDBX_txn *txn,
|
|||||||
|
|
||||||
arg->mi_self_latter_reader_txnid = arg->mi_latter_reader_txnid =
|
arg->mi_self_latter_reader_txnid = arg->mi_latter_reader_txnid =
|
||||||
arg->mi_recent_txnid;
|
arg->mi_recent_txnid;
|
||||||
for (unsigned i = 0; i < arg->mi_numreaders; ++i) {
|
if (env->me_lck_mmap.lck) {
|
||||||
const uint32_t pid =
|
for (unsigned i = 0; i < arg->mi_numreaders; ++i) {
|
||||||
atomic_load32(&lck->mti_readers[i].mr_pid, mo_AcquireRelease);
|
const uint32_t pid =
|
||||||
if (pid) {
|
atomic_load32(&lck->mti_readers[i].mr_pid, mo_AcquireRelease);
|
||||||
const txnid_t txnid = safe64_read(&lck->mti_readers[i].mr_txnid);
|
if (pid) {
|
||||||
if (arg->mi_latter_reader_txnid > txnid)
|
const txnid_t txnid = safe64_read(&lck->mti_readers[i].mr_txnid);
|
||||||
arg->mi_latter_reader_txnid = txnid;
|
if (arg->mi_latter_reader_txnid > txnid)
|
||||||
if (pid == env->me_pid && arg->mi_self_latter_reader_txnid > txnid)
|
arg->mi_latter_reader_txnid = txnid;
|
||||||
arg->mi_self_latter_reader_txnid = txnid;
|
if (pid == env->me_pid && arg->mi_self_latter_reader_txnid > txnid)
|
||||||
|
arg->mi_self_latter_reader_txnid = txnid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user