Skip to content

Commit

Permalink
Add getting started section
Browse files Browse the repository at this point in the history
  • Loading branch information
anokl committed Dec 12, 2017
1 parent 77342e6 commit fcda137
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ struct PrintingEventHandler : Disruptor::IEventHandler< LongEvent >
std::cout << "Event: " << event.value << std::endl;

if (++m_actuallyProcessed == m_toProcess)
allDone.notify_all();
m_allDone.notify_all();
}

void waitEndOfProcessing()
{
std::unique_lock<std::mutex> lk(m);
allDone.wait(lk);
std::unique_lock<decltype(m_mutex)> lk(m_mutex);
m_allDone.wait(lk);
}

private:
std::mutex m;
std::condition_variable allDone;
std::mutex m_mutex;
std::condition_variable m_allDone;
int m_toProcess;
int m_actuallyProcessed;
};
Expand Down

0 comments on commit fcda137

Please sign in to comment.