Pepper: Narrow locking at ld subprocess start.
commite15801b5bbfd68e19c91bce40a91e6bf7f6d675d
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 3 Jun 2014 17:14:48 +0000 (3 17:14 +0000)
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 3 Jun 2014 17:14:48 +0000 (3 17:14 +0000)
tree7c060561e5e9c246197bdcaadf83dad3cf6b78ed
parenta1268362fd1278e7f9baa03cd44ee515b3f89949
Pepper: Narrow locking at ld subprocess start.

Currently, subprocess_mu_ is held the entire time the ld subprocess is
starting. This blocks a larger refactor that I'd like to make as part of nexe
loading.

I'd like to change ServiceRuntime::LoadModule() to be asynchronous to simplify
threading behavior on the plugin side when loading nexe modules. However, this
requires that many methods are made asynchronous, including
Plugin::LoadHelperNaClModule().

PnaclTranslateThread will need to use a pattern similar to WaitForSelLdrStart()
to resume execution on a background thread. However, I don't like the idea of
introducing another mutex and condvar to deal with while holding
subprocess_mu_.

This change narrows the time that subprocess_mu_ is held to make that refactor
possible. This follows a similar change made for the llc subprocess.

BUG=333950
R=bbudge@chromium.org

Review URL: https://codereview.chromium.org/308193004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274557 0039d316-1c4b-4281-b951-d872f2087c98
ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc