Fixed a deadlock upon disposal in AggregateBuilder. #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #470.
Removed also a stale test case.
The deadlock happens when a
valueevent of a combined signal triggers termination of one of its source signals (except for the one that indirectly yields thevalueevent).Example: https://github.com/ReactiveCocoa/ReactiveSwift/pull/471/files#diff-8c46f2726f3ee5a6dbf7ad24b29dbd57R2795
The value from
Byields a new(A, B)tuple, leading to termination ofAand eventually informing the strategy with the completion ofA. Since the delivery of the tuple is in progress, the strategy's internal lock is still acquired, resulting in the deadlock.Threading of the signal aggregate strategies now mirrors that of
Signal.Coreto allow recursive termial event sent by avalueevent.Checklist