Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: components/nacl/renderer/plugin/pnacl_translate_thread.cc

Issue 1128373005: PNaCl: Hold subprocess_mu while doing StartSrpcServices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/renderer/plugin/pnacl_translate_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/plugin/pnacl_translate_thread.cc
diff --git a/components/nacl/renderer/plugin/pnacl_translate_thread.cc b/components/nacl/renderer/plugin/pnacl_translate_thread.cc
index 9ff9ff651086304f2cb1ad2b46f818bf4e300357..6e4d45d7711ddfef633aea4b3b752170c1680fa8 100644
--- a/components/nacl/renderer/plugin/pnacl_translate_thread.cc
+++ b/components/nacl/renderer/plugin/pnacl_translate_thread.cc
@@ -190,21 +190,20 @@ void WINAPI PnaclTranslateThread::DoCompileThread(void* arg) {
}
void PnaclTranslateThread::DoCompile() {
- // If the main thread asked us to exit in between starting the thread
- // and now, just leave now.
{
nacl::MutexLocker ml(&subprocess_mu_);
+ // If the main thread asked us to exit in between starting the thread
+ // and now, just leave now.
if (!compiler_subprocess_active_)
return;
- }
-
- // Now that we are in helper thread, we can do the the blocking
- // StartSrpcServices operation.
- if (!compiler_subprocess_->StartSrpcServices()) {
- TranslateFailed(
- PP_NACL_ERROR_SRPC_CONNECTION_FAIL,
- "SRPC connection failure for " + compiler_subprocess_->description());
- return;
+ // Now that we are in helper thread, we can do the the blocking
+ // StartSrpcServices operation.
+ if (!compiler_subprocess_->StartSrpcServices()) {
+ TranslateFailed(
+ PP_NACL_ERROR_SRPC_CONNECTION_FAIL,
+ "SRPC connection failure for " + compiler_subprocess_->description());
+ return;
+ }
}
SrpcParams params;
@@ -338,21 +337,20 @@ void WINAPI PnaclTranslateThread::DoLinkThread(void* arg) {
}
void PnaclTranslateThread::DoLink() {
- // If the main thread asked us to exit in between starting the thread
- // and now, just leave now.
{
nacl::MutexLocker ml(&subprocess_mu_);
+ // If the main thread asked us to exit in between starting the thread
+ // and now, just leave now.
if (!ld_subprocess_active_)
return;
- }
-
- // Now that we are in helper thread, we can do the the blocking
- // StartSrpcServices operation.
- if (!ld_subprocess_->StartSrpcServices()) {
- TranslateFailed(
- PP_NACL_ERROR_SRPC_CONNECTION_FAIL,
- "SRPC connection failure for " + ld_subprocess_->description());
- return;
+ // Now that we are in helper thread, we can do the the blocking
+ // StartSrpcServices operation.
+ if (!ld_subprocess_->StartSrpcServices()) {
+ TranslateFailed(
+ PP_NACL_ERROR_SRPC_CONNECTION_FAIL,
+ "SRPC connection failure for " + ld_subprocess_->description());
+ return;
+ }
}
SrpcParams params;
« no previous file with comments | « components/nacl/renderer/plugin/pnacl_translate_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698