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 double-decoration error #923

Merged
merged 5 commits into from May 5, 2016
Merged

Fix double-decoration error #923

merged 5 commits into from May 5, 2016

Conversation

veronicaz41
Copy link
Contributor

@veronicaz41 veronicaz41 commented May 5, 2016

The problem is if an auto filter has multiple inputs marked as unsatisfiable, each time it is marked as unsatisfiable, we call IncProducerCount, so the auto filter will become complete prematurely.
The fix is to make sure IncProducerCount only got called once for each auto filter, only when all its inputs are satisfied or marked as unsatisfiable.

@@ -279,7 +279,9 @@ void AutoPacket::UpdateSatisfactionUnsafe(std::unique_lock<std::mutex> lk, const

// Recursively mark unsatisfiable any single-output arguments on these subscribers:
std::vector<const AutoFilterArgument*> unsatOutputArgs;
auto MarkOutputsUnsat = [&unsatOutputArgs] (const SatCounter& satCounter) {
auto MarkOutputsUnsat = [&unsatOutputArgs] (SatCounter satCounter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, a mistake

@codemercenary codemercenary added this to the v1.0.1 milestone May 5, 2016
@codemercenary codemercenary self-assigned this May 5, 2016
@@ -34,7 +34,7 @@ struct SatCounter:
/// </summary>
/// <returns>True if this decrement yielded satisfaction of all arguments</returns>
bool Decrement(void) {
return !--remaining;
return remaining && !--remaining;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like compact logic.

@codemercenary codemercenary merged commit c2dfc5b into master May 5, 2016
@codemercenary codemercenary deleted the fix-920 branch May 5, 2016 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants