-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mpsc): fix a deadlock in async send_ref (#20)
This fixes a deadlock issue in the async MPSC's `send_ref` method. The deadlock occurs when a new waker needs to be registered for a task whose wait node is already in the wait queue. Previously, the new waker would not be registered because the waker registering closure was only called when the node was being enqueued. If the node was already in the queue, polling the future would never touch the waker. This means that if the task was polled with a new waker, it would leave its old waker in the queue, and might never be notified again. This branch fixes that by separating pushing the task and registering the waker. We check if the node already has a waker prior to registering, and if it did, we don't push it again. Signed-off-by: Eliza Weisman <[email protected]>
- Loading branch information
Showing
6 changed files
with
116 additions
and
117 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
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
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
Oops, something went wrong.