From 0a364aefbb78721a4decea8ec48b44998800d9af 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: Thu, 2 Jan 2025 11:15:19 +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`txn::make=5Fbroken()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h | 2 +- mdbx.h++ | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mdbx.h b/mdbx.h index ffb8ef69..af01e309 100644 --- a/mdbx.h +++ b/mdbx.h @@ -4235,7 +4235,7 @@ LIBMDBX_INLINE_API(int, mdbx_txn_commit, (MDBX_txn * txn)) { return mdbx_txn_com * \retval MDBX_EINVAL Transaction handle is NULL. */ LIBMDBX_API int mdbx_txn_abort(MDBX_txn *txn); -/** \brief Marks transaction as broken. +/** \brief Marks transaction as broken to prevent further operations. * \ingroup c_transactions * * Function keeps the transaction handle and corresponding locks, but makes diff --git a/mdbx.h++ b/mdbx.h++ index b5e28262..2d895d03 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -3799,6 +3799,9 @@ public: /// \brief Renew read-only transaction. inline void renew_reading(); + /// \brief Marks transaction as broken to prevent further operations. + inline void make_broken(); + /// \brief Park read-only transaction. inline void park_reading(bool autounpark = true); @@ -5578,6 +5581,8 @@ inline uint64_t txn::id() const { inline void txn::reset_reading() { error::success_or_throw(::mdbx_txn_reset(handle_)); } +inline void txn::make_broken() { error::success_or_throw(::mdbx_txn_break(handle_)); } + 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)); }