mdbx++: добавление (рас)парковки транзакций чтения в C++ API.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-07-24 19:58:02 +03:00
parent 2e7d325cf1
commit 7873118cdb

View File

@ -4357,12 +4357,19 @@ public:
//----------------------------------------------------------------------------
/// \brief Reset a read-only transaction.
/// \brief Reset read-only transaction.
inline void reset_reading();
/// \brief Renew a read-only transaction.
/// \brief Renew read-only transaction.
inline void renew_reading();
/// \brief Park read-only transaction.
inline void park_reading(bool autounpark = true);
/// \brief Resume parked read-only transaction.
/// \returns True if transaction was restarted while `restart_if_ousted=true`.
inline bool unpark_reading(bool restart_if_ousted = true);
/// \brief Start nested write transaction.
txn_managed start_nested();
@ -6450,6 +6457,14 @@ inline void txn::renew_reading() {
error::success_or_throw(::mdbx_txn_renew(handle_));
}
inline void txn::park_reading(bool autounpark) {
error::success_or_throw(::mdbx_txn_park(handle_, autounpark));
}
inline bool txn::unpark_reading(bool restart_if_ousted) {
return error::boolean_or_throw(::mdbx_txn_unpark(handle_, restart_if_ousted));
}
inline txn::info txn::get_info(bool scan_reader_lock_table) const {
txn::info r;
error::success_or_throw(::mdbx_txn_info(handle_, &r, scan_reader_lock_table));