forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mojo] Do not read mojo messages until they can be dispatched
Before this change, logic allowed dequeuing messages from mojo pipe and holding them inside internal queue (|Connector::dispatch_queue_|) until a future post-task would dispatch them. If - however - the receiver would be unbound between these moments, all dequeued messages would be lost. For async mojo calls, this may lead to logic problems. For sync calls, it will deadlock the whole calling thread. This change removes the |dispatch_queue_|, simplifies the logic of dispatching messages from mojo pipe and ensures that no mojo message can be dequeued without dispatching it. A new unit test is added to ensure that implementation is not vulnerable to such a problem anymore. Without the patch, it deadlocks as the sync message is dropped on the receiver's thread during rebinding of the |mojo::Receiver| objects. Bug: 1066761 Change-Id: I94af241dca6656c8dc0e21fb8c7ec75c9f9a0b32 Tbr: wez@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139704 Commit-Queue: Ken Rockot <rockot@google.com> Reviewed-by: Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#765123}
- Loading branch information
Damian Dyńdo
authored and
Commit Bot
committed
May 4, 2020
1 parent
ba7c696
commit a0aa431
Showing
5 changed files
with
143 additions
and
155 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
Oops, something went wrong.