Index: runtime/bin/process_android.cc |
diff --git a/runtime/bin/process_android.cc b/runtime/bin/process_android.cc |
index 550f680a0861d9894b2557149f7d139ed65119fe..11949ba8a2d0b2adf505d0f9e58269f6be1b874d 100644 |
--- a/runtime/bin/process_android.cc |
+++ b/runtime/bin/process_android.cc |
@@ -163,9 +163,12 @@ class ExitCodeHandler { |
// monitor. |
running_ = false; |
- // Fork to wake up waitpid. |
+ // Wake up the [ExitCodeHandler] thread which is blocked on `wait()` (see |
+ // [ExitCodeHandlerEntry]). |
if (TEMP_FAILURE_RETRY(fork()) == 0) { |
- exit(0); |
+ // We avoid running through registered atexit() handlers because that is |
+ // unnecessary work. |
+ _exit(0); |
} |
monitor_->Notify(); |