mdbx-tests: исправление extra/cursor-closing для старых стандартов C++.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2025-04-20 00:45:16 +03:00
parent 668a1e42e3
commit 072103ab67
No known key found for this signature in database
GPG Key ID: 518BD10B927E8686

View File

@ -285,11 +285,15 @@ void case1_write_cycle(mdbx::txn_managed txn, std::deque<mdbx::map_handle> &dbi,
}
bool case1_thread(mdbx::env env, std::deque<mdbx::map_handle> dbi, mdbx::cursor pre) {
#if defined(__cpp_lib_latch) && __cpp_lib_latch >= 201907L
mdbx::error::success_or_throw(mdbx_txn_lock(env, false));
std::hash<std::thread::id> hasher;
salt = global_seed ^ hasher(std::this_thread::get_id());
std::cout << "thread " << std::this_thread::get_id() << ", salt " << salt << std::endl << std::flush;
mdbx_txn_unlock(env);
#else
salt = global_seed;
#endif
std::vector<MDBX_cursor *> pool;
for (auto loop = 0; loop < 333 / RELIEF_FACTOR; ++loop) {