-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Channel dropping values in certain conditions
The type std.sync.Channel is built on top of the Future and Promise types. The implementation of Promise.set was such that if it's disconnected prior to a write, the value would be dropped silently. Combined with how Channel was implemented, this could result in sent values being discarded. To resolve this, Promise.set now returns the value to set if its corresponding Future is already dropped, allowing callers to act accordingly. The implementation of Channel in turn is changed to take advantage of this, and to ensure values are always resolved in FIFO order. Changelog: fixed
- Loading branch information
1 parent
888832e
commit 98c7f1e
Showing
2 changed files
with
106 additions
and
10 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