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

Side by Side Diff: runtime/bin/process_android.cc

Issue 2618723002: Workaround attempt for timeout flakiness: Avoid running atexit() handlers in fork()ed process on li… (Closed)
Patch Set: add comment Created 3 years, 11 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 | runtime/bin/process_linux.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 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 MonitorLocker locker(monitor_); 156 MonitorLocker locker(monitor_);
157 157
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 // Wake up the [ExitCodeHandler] thread which is blocked on `wait()` (see
167 // [ExitCodeHandlerEntry]).
167 if (TEMP_FAILURE_RETRY(fork()) == 0) { 168 if (TEMP_FAILURE_RETRY(fork()) == 0) {
168 exit(0); 169 // We avoid running through registered atexit() handlers because that is
170 // unnecessary work.
171 _exit(0);
169 } 172 }
170 173
171 monitor_->Notify(); 174 monitor_->Notify();
172 175
173 while (!terminate_done_) { 176 while (!terminate_done_) {
174 monitor_->Wait(Monitor::kNoTimeout); 177 monitor_->Wait(Monitor::kNoTimeout);
175 } 178 }
176 } 179 }
177 180
178 private: 181 private:
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL)); 993 VOID_NO_RETRY_EXPECTED(sigaction(signal, &act, NULL));
991 } 994 }
992 } 995 }
993 996
994 } // namespace bin 997 } // namespace bin
995 } // namespace dart 998 } // namespace dart
996 999
997 #endif // defined(TARGET_OS_ANDROID) 1000 #endif // defined(TARGET_OS_ANDROID)
998 1001
999 #endif // !defined(DART_IO_DISABLED) 1002 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698