-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix races in emission vs. request #1140
onNext now uses decrement instead of compareAndSet to avoid races with request(n) calls ensuring that all elements get emitted. This allows simplification of readAndPublish() and eliminating another race where completion was potentially dropped. Completion now also considers the guard through READING instead of completing from any state to protect against active drain loops.
- Loading branch information
Showing
2 changed files
with
53 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters