mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: add mdbx_txn_flags().
This commit is contained in:
parent
d63c2484fe
commit
a2ec7f2be1
9
mdbx.h
9
mdbx.h
@ -982,6 +982,15 @@ LIBMDBX_API int mdbx_txn_begin(MDBX_env *env, MDBX_txn *parent, unsigned flags,
|
|||||||
* [in] txn A transaction handle returned by mdbx_txn_begin() */
|
* [in] txn A transaction handle returned by mdbx_txn_begin() */
|
||||||
LIBMDBX_API MDBX_env *mdbx_txn_env(MDBX_txn *txn);
|
LIBMDBX_API MDBX_env *mdbx_txn_env(MDBX_txn *txn);
|
||||||
|
|
||||||
|
/* Return the transaction's flags.
|
||||||
|
*
|
||||||
|
* This returns the flags associated with this transaction.
|
||||||
|
*
|
||||||
|
* [in] txn A transaction handle returned by mdbx_txn_begin()
|
||||||
|
*
|
||||||
|
* Returns A transaction flags, valid if input is an active transaction. */
|
||||||
|
LIBMDBX_API int mdbx_txn_flags(MDBX_txn *txn);
|
||||||
|
|
||||||
/* Return the transaction's ID.
|
/* Return the transaction's ID.
|
||||||
*
|
*
|
||||||
* This returns the identifier associated with this transaction. For a
|
* This returns the identifier associated with this transaction. For a
|
||||||
|
@ -2987,6 +2987,13 @@ uint64_t mdbx_txn_id(MDBX_txn *txn) {
|
|||||||
return txn->mt_txnid;
|
return txn->mt_txnid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mdbx_txn_flags(MDBX_txn *txn) {
|
||||||
|
if (unlikely(!txn || txn->mt_signature != MDBX_MT_SIGNATURE))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return txn->mt_flags;
|
||||||
|
}
|
||||||
|
|
||||||
/* Export or close DBI handles opened in this txn. */
|
/* Export or close DBI handles opened in this txn. */
|
||||||
static void mdbx_dbis_update(MDBX_txn *txn, int keep) {
|
static void mdbx_dbis_update(MDBX_txn *txn, int keep) {
|
||||||
MDBX_dbi n = txn->mt_numdbs;
|
MDBX_dbi n = txn->mt_numdbs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user