Allow reader and writer transactions in the same thread
This is supported by LMDB if the MDB_NOTLS flag is set on the environment, which it always is with lmdb-safe. Fixes #9.
This commit is contained in:
parent
551339ff8f
commit
91920e7c3b
|
@ -163,7 +163,7 @@ MDBRWTransactionImpl::MDBRWTransactionImpl(MDBEnv *parent, MDB_txn *txn):
|
|||
MDB_txn *MDBRWTransactionImpl::openRWTransaction(MDBEnv *env, MDB_txn *parent, unsigned int flags)
|
||||
{
|
||||
MDB_txn *result;
|
||||
if(env->getROTX() || env->getRWTX())
|
||||
if(env->getRWTX())
|
||||
throw std::runtime_error("Duplicate RW transaction");
|
||||
|
||||
for(int tries =0 ; tries < 3; ++tries) { // it might happen twice, who knows
|
||||
|
|
Loading…
Reference in New Issue