Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #36: fix broken BlockingStrategy #44

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions disruptor/sequence_barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ namespace disruptor {
template <typename W = kDefaultWaitStrategy>
class SequenceBarrier {
public:
SequenceBarrier(const Sequence& cursor,
SequenceBarrier(W& wait_strategy, const Sequence& cursor,
const std::vector<Sequence*>& dependents)
: cursor_(cursor), dependents_(dependents), alerted_(false) {}
: wait_strategy_(wait_strategy) cursor_(cursor), dependents_(dependents), alerted_(false) {}

int64_t WaitFor(const int64_t& sequence) {
return wait_strategy_.WaitFor(sequence, cursor_, dependents_, alerted_);
Expand All @@ -63,7 +63,7 @@ class SequenceBarrier {
}

private:
W wait_strategy_;
W& wait_strategy_;
const Sequence& cursor_;
std::vector<Sequence*> dependents_;
std::atomic<bool> alerted_;
Expand Down
2 changes: 1 addition & 1 deletion disruptor/sequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Sequencer {
// @param sequences_to_track this barrier will track.
// @return the barrier gated as required.
SequenceBarrier<W> NewBarrier(const std::vector<Sequence*>& dependents) {
return SequenceBarrier<W>(cursor_, dependents);
return SequenceBarrier<W>(wait_strategy_, cursor_, dependents);
}

// Get the value of the cursor indicating the published sequence.
Expand Down