From 7873118cdb4faeb745f230da72729ccea1c077bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Wed, 24 Jul 2024 19:58:02 +0300 Subject: [PATCH] =?UTF-8?q?mdbx++:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20(=D1=80=D0=B0=D1=81)=D0=BF=D0=B0?= =?UTF-8?q?=D1=80=D0=BA=D0=BE=D0=B2=D0=BA=D0=B8=20=D1=82=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D1=86=D0=B8=D0=B9=20=D1=87=D1=82=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20C++=20API.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index 9d2197bb..7ef55c18 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -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));