DescriptionMove PNaCl process startup back to the main thread.
Previously it was split between the helper thread and
the main thread. Way back in the day it was only the
helper thread, but there was concern about thread-safety
and part of the process moved to the main thread,
straddling two threads. Now we move all the way back to
the main thread only.
This removes the need to have "WaitFor*Start" in the helper
thread. Otherwise the helper thread would post work to
the main thread, and wait. That makes it very risky w.r.t.
deadlock, since the main thread will join() the helper
thread as part of plugin teardown. We had a bunch of
workarounds like a timeout when waiting on the condvar.
The bad thing about main thread loads is that it blocks
the renderer from doing work (like animation) as the nexe
loads. However, since we bounce work to the main thread
anyway, we block right now without this CL already.
In a later CL we can take advantage of the sel_main_chrome
load status hook to know when the nexe load is about done,
and only then call-back into the plugin when the blocking
is minimized. Hook added here:
https://codereview.chromium.org/1090233003/diff/100001/components/nacl/common/nacl_renderer_messages.h
SRPC client connection is still done on the helper thread.
I'm not sure of the requirement, but it will block
indefinitely if we do that in the main thread so
I left that in the helper thread.
There's still a bunch of pnacl_translate_thread mutexes
and condvars and the *_subprocess_active flags left
in the pnacl_translate_thread. Haven't moved the
activeness tracking out so that's left as is.
BUG=473474
Committed: https://crrev.com/a26ccdf90ca5f7464df921c72d18ec52d5e27d09
Cr-Commit-Position: refs/heads/master@{#329409}
Patch Set 1 #Patch Set 2 : Tiny bit of cleanup. #Patch Set 3 : more checks #Patch Set 4 : remove unused field #
Total comments: 17
Patch Set 5 : review #Patch Set 6 : rebase #Messages
Total messages: 19 (5 generated)
|