Skip to content

Commit

Permalink
Beginning of allowing overlap on single thread
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Mar 7, 2024
1 parent 49847c6 commit 9ee40d0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ bool WriteWorker::threadSafeCallsEnabled = false;
void txn_visible(const void* data) {
auto worker = (WriteWorker*) data;
worker->SendUpdate();
/*if (worker->txn) {
worker->txn = nullptr;
worker->interruptionStatus = 0;
pthread_cond_signal(worker->envForTxn->writingCond); // in case there a sync txn waiting for us
pthread_mutex_unlock(worker->envForTxn->writingLock);
}*/
}


Expand Down Expand Up @@ -493,10 +499,12 @@ void WriteWorker::Write() {
if (rc == MDB_EMPTY_TXN)
rc = 0;
#endif
txn = nullptr;
interruptionStatus = 0;
pthread_cond_signal(envForTxn->writingCond); // in case there a sync txn waiting for us
pthread_mutex_unlock(envForTxn->writingLock);
if (txn) {
txn = nullptr;
interruptionStatus = 0;
pthread_cond_signal(envForTxn->writingCond); // in case there a sync txn waiting for us
pthread_mutex_unlock(envForTxn->writingLock);
}
if (rc || resultCode) {
std::atomic_fetch_or((std::atomic<uint32_t>*) instructions, (uint32_t) TXN_HAD_ERROR);
if (rc)
Expand Down

0 comments on commit 9ee40d0

Please sign in to comment.