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

Side by Side Diff: components/nacl/renderer/plugin/pnacl_translate_thread.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | components/nacl/renderer/plugin/pnacl_translate_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_ 5 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_
6 #define COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_ 6 #define COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Used to guard compiler_subprocess, ld_subprocess, 106 // Used to guard compiler_subprocess, ld_subprocess,
107 // compiler_subprocess_active_, and ld_subprocess_active_ 107 // compiler_subprocess_active_, and ld_subprocess_active_
108 // (touched by the main thread and the translate thread). 108 // (touched by the main thread and the translate thread).
109 struct NaClMutex subprocess_mu_; 109 struct NaClMutex subprocess_mu_;
110 // The compiler_subprocess and ld_subprocess memory is owned by the 110 // The compiler_subprocess and ld_subprocess memory is owned by the
111 // coordinator so we do not delete them. However, the main thread delegates 111 // coordinator so we do not delete them. However, the main thread delegates
112 // shutdown to this thread, since this thread may still be accessing the 112 // shutdown to this thread, since this thread may still be accessing the
113 // subprocesses. The *_subprocess_active flags indicate which subprocesses 113 // subprocesses. The *_subprocess_active flags indicate which subprocesses
114 // are active to ensure the subprocesses don't get shutdown more than once. 114 // are active to ensure the subprocesses don't get shutdown more than once.
115 // The subprocess_mu_ must be held when shutting down the subprocesses 115 // The subprocess_mu_ must be held when shutting down the subprocesses
116 // or checking if it's already shut down (via the active flags). 116 // or otherwise accessing the service_runtime component of the subprocess.
117 // There are some accesses to the subprocesses without locks held 117 // There are some accesses to the subprocesses without locks held
118 // (invoking SRPC methods client). 118 // (invoking srpc_client methods -- in contrast to using the service_runtime).
119 NaClSubprocess* compiler_subprocess_; 119 NaClSubprocess* compiler_subprocess_;
120 NaClSubprocess* ld_subprocess_; 120 NaClSubprocess* ld_subprocess_;
121 bool compiler_subprocess_active_; 121 bool compiler_subprocess_active_;
122 bool ld_subprocess_active_; 122 bool ld_subprocess_active_;
123 123
124 // Condition variable to synchronize communication with the SRPC thread. 124 // Condition variable to synchronize communication with the SRPC thread.
125 // SRPC thread waits on this condvar if data_buffers_ is empty (meaning 125 // SRPC thread waits on this condvar if data_buffers_ is empty (meaning
126 // there is no bitcode to send to the translator), and the main thread 126 // there is no bitcode to send to the translator), and the main thread
127 // appends to data_buffers_ and signals it when it receives bitcode. 127 // appends to data_buffers_ and signals it when it receives bitcode.
128 struct NaClCondVar buffer_cond_; 128 struct NaClCondVar buffer_cond_;
(...skipping 16 matching lines...) Expand all
145 ErrorInfo* coordinator_error_info_; 145 ErrorInfo* coordinator_error_info_;
146 PP_PNaClOptions* pnacl_options_; 146 PP_PNaClOptions* pnacl_options_;
147 std::string architecture_attributes_; 147 std::string architecture_attributes_;
148 PnaclCoordinator* coordinator_; 148 PnaclCoordinator* coordinator_;
149 private: 149 private:
150 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); 150 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread);
151 }; 151 };
152 152
153 } 153 }
154 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_ 154 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_PNACL_TRANSLATE_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | components/nacl/renderer/plugin/pnacl_translate_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698