OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #if !defined(DART_IO_DISABLED) | 5 #if !defined(DART_IO_DISABLED) |
6 | 6 |
7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
8 #if defined(TARGET_OS_ANDROID) | 8 #if defined(TARGET_OS_ANDROID) |
9 | 9 |
10 #include "bin/process.h" | 10 #include "bin/process.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 if (!running_) { | 158 if (!running_) { |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 // Set terminate_done_ to false, so we can use it as a guard for our | 162 // Set terminate_done_ to false, so we can use it as a guard for our |
163 // monitor. | 163 // monitor. |
164 running_ = false; | 164 running_ = false; |
165 | 165 |
166 // Fork to wake up waitpid. | 166 // Fork to wake up waitpid. |
167 if (TEMP_FAILURE_RETRY(fork()) == 0) { | 167 if (TEMP_FAILURE_RETRY(fork()) == 0) { |
168 exit(0); | 168 _exit(0); |
Vyacheslav Egorov (Google)
2017/01/05 12:43:37
Please leave a comment here why _exit and not exit
kustermann
2017/01/05 12:55:34
Done.
| |
169 } | 169 } |
170 | 170 |
171 monitor_->Notify(); | 171 monitor_->Notify(); |
172 | 172 |
173 while (!terminate_done_) { | 173 while (!terminate_done_) { |
174 monitor_->Wait(Monitor::kNoTimeout); | 174 monitor_->Wait(Monitor::kNoTimeout); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 private: | 178 private: |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
990 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); | 990 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); |
991 } | 991 } |
992 } | 992 } |
993 | 993 |
994 } // namespace bin | 994 } // namespace bin |
995 } // namespace dart | 995 } // namespace dart |
996 | 996 |
997 #endif // defined(TARGET_OS_ANDROID) | 997 #endif // defined(TARGET_OS_ANDROID) |
998 | 998 |
999 #endif // !defined(DART_IO_DISABLED) | 999 #endif // !defined(DART_IO_DISABLED) |
OLD | NEW |