mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-05 12:52:20 +08:00
mdbx: cleanup after last pull-request.
Cleanup after 4e40af60e7
(Merge pull request #20 from rouzier/feature/txn_try).
This commit is contained in:
@@ -20,7 +20,14 @@
|
||||
|
||||
#define ACTOR_ID_MAX INT16_MAX
|
||||
|
||||
enum actor_testcase { ac_none, ac_hill, ac_deadread, ac_deadwrite, ac_jitter, ac_try };
|
||||
enum actor_testcase {
|
||||
ac_none,
|
||||
ac_hill,
|
||||
ac_deadread,
|
||||
ac_deadwrite,
|
||||
ac_jitter,
|
||||
ac_try
|
||||
};
|
||||
|
||||
enum actor_status {
|
||||
as_unknown,
|
||||
|
@@ -178,17 +178,18 @@ void testcase::db_close() {
|
||||
}
|
||||
|
||||
void testcase::txn_begin(unsigned flags) {
|
||||
log_trace(">> txn_begin(%s)", flags & MDBX_RDONLY ? "read-only" : "read-write");
|
||||
log_trace(">> txn_begin(%s)",
|
||||
flags & MDBX_RDONLY ? "read-only" : "read-write");
|
||||
assert(!txn_guard);
|
||||
|
||||
MDBX_txn *txn = nullptr;
|
||||
int rc =
|
||||
mdbx_txn_begin(db_guard.get(), nullptr, flags, &txn);
|
||||
int rc = mdbx_txn_begin(db_guard.get(), nullptr, flags, &txn);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_txn_begin()", rc);
|
||||
txn_guard.reset(txn);
|
||||
|
||||
log_trace("<< txn_begin(%s)", flags & MDBX_RDONLY ? "read-only" : "read-write");
|
||||
log_trace("<< txn_begin(%s)",
|
||||
flags & MDBX_RDONLY ? "read-only" : "read-write");
|
||||
}
|
||||
|
||||
void testcase::txn_end(bool abort) {
|
||||
|
@@ -15,8 +15,7 @@ bool testcase_try::run() {
|
||||
|
||||
MDBX_txn *txn = nullptr;
|
||||
MDBX_txn *txn2 = nullptr;
|
||||
int rc =
|
||||
mdbx_txn_begin(db_guard.get(), nullptr, 0, &txn);
|
||||
int rc = mdbx_txn_begin(db_guard.get(), nullptr, 0, &txn);
|
||||
if (unlikely(rc != MDBX_SUCCESS))
|
||||
failure_perror("mdbx_txn_begin(MDBX_TRYTXN)", rc);
|
||||
else {
|
||||
|
Reference in New Issue
Block a user