Electroneum
lmdb::release_read_txn Struct Reference

#include <transaction.h>

Public Member Functions

void operator() (MDB_txn *ptr) const noexcept
 

Detailed Description

Only valid if used via create_read_txn(). Decrements active count in associated context, and aborts a LMDB transaction (mdb_txn_abort).

Definition at line 54 of file transaction.h.

Member Function Documentation

◆ operator()()

void lmdb::release_read_txn::operator() ( MDB_txn ptr) const
noexcept

Definition at line 63 of file database.cpp.

64  {
65  if (ptr)
66  {
67  MDB_env* const env = mdb_txn_env(ptr);
68  abort_txn{}(ptr);
69  if (env)
70  {
71  context* ctx = reinterpret_cast<context*>(mdb_env_get_userctx(env));
72  if (ctx)
73  release_context(*ctx);
74  }
75  }
76  }
void * mdb_env_get_userctx(MDB_env *env)
Get the application information associated with the MDB_env.
struct MDB_env MDB_env
Opaque structure for a database environment.
Definition: lmdb.h:260
MDB_env * mdb_txn_env(MDB_txn *txn)
Returns the transaction&#39;s MDB_env.
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
Definition: zmq.h:98

The documentation for this struct was generated from the following files: