Fix lock-order-inversion in ChannelMojo
The following lock sequences are possible:
1. ChannelMojo lock (A) is held for Connect when calling
bootstrap_->Connect(), which in turn binds the
Binding, starting a MojoWatch which locks the internal
lock (B) for the watcher. So A => B.
2. An incoming IPC wakes the watcher (B) and calls
SyncMessageFilter::OnMessageReceived which locks SMF's
lock (C). So B => C.
3. Sending an IPC locks SMF's lock (C) and then locks
ChannelMojo's lock (A) while holding C. So C => A.
This CL eliminates the A => B => C => A cycle by avoiding
case 1. There's no need to hold ChannelMojo's lock while
connecting the Bootstrap.
BUG=606701
[email protected]
Review-Url: https://codereview.chromium.org/1937733002
Cr-Commit-Position: refs/heads/master@{#390880}
1 file changed