OLD | NEW |
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 NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 nacl::scoped_ptr<NaClThread> translate_thread_; | 85 nacl::scoped_ptr<NaClThread> translate_thread_; |
86 | 86 |
87 // Used to guard llc_subprocess and ld_subprocess | 87 // Used to guard llc_subprocess and ld_subprocess |
88 struct NaClMutex subprocess_mu_; | 88 struct NaClMutex subprocess_mu_; |
89 nacl::scoped_ptr<NaClSubprocess> llc_subprocess_; | 89 nacl::scoped_ptr<NaClSubprocess> llc_subprocess_; |
90 nacl::scoped_ptr<NaClSubprocess> ld_subprocess_; | 90 nacl::scoped_ptr<NaClSubprocess> ld_subprocess_; |
91 // Used to ensure the subprocesses don't get shutdown more than once. | 91 // Used to ensure the subprocesses don't get shutdown more than once. |
92 bool llc_subprocess_active_; | 92 bool llc_subprocess_active_; |
93 bool ld_subprocess_active_; | 93 bool ld_subprocess_active_; |
94 | 94 |
| 95 bool subprocesses_aborted_; |
| 96 |
95 // Condition variable to synchronize communication with the SRPC thread. | 97 // Condition variable to synchronize communication with the SRPC thread. |
96 // SRPC thread waits on this condvar if data_buffers_ is empty (meaning | 98 // SRPC thread waits on this condvar if data_buffers_ is empty (meaning |
97 // there is no bitcode to send to the translator), and the main thread | 99 // there is no bitcode to send to the translator), and the main thread |
98 // appends to data_buffers_ and signals it when it receives bitcode. | 100 // appends to data_buffers_ and signals it when it receives bitcode. |
99 struct NaClCondVar buffer_cond_; | 101 struct NaClCondVar buffer_cond_; |
100 // Mutex for buffer_cond_. | 102 // Mutex for buffer_cond_. |
101 struct NaClMutex cond_mu_; | 103 struct NaClMutex cond_mu_; |
102 // Data buffers from FileDownloader are enqueued here to pass from the | 104 // Data buffers from FileDownloader are enqueued here to pass from the |
103 // main thread to the SRPC thread. Protected by cond_mu_ | 105 // main thread to the SRPC thread. Protected by cond_mu_ |
104 std::deque<std::vector<char> > data_buffers_; | 106 std::deque<std::vector<char> > data_buffers_; |
(...skipping 12 matching lines...) Expand all Loading... |
117 PP_PNaClOptions* pnacl_options_; | 119 PP_PNaClOptions* pnacl_options_; |
118 nacl::string architecture_attributes_; | 120 nacl::string architecture_attributes_; |
119 PnaclCoordinator* coordinator_; | 121 PnaclCoordinator* coordinator_; |
120 Plugin* plugin_; | 122 Plugin* plugin_; |
121 private: | 123 private: |
122 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); | 124 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); |
123 }; | 125 }; |
124 | 126 |
125 } | 127 } |
126 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 128 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
OLD | NEW |