| 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 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "bin/process.h" | 8 #include "bin/process.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Mark write end non-blocking. | 146 // Mark write end non-blocking. |
| 147 FDUtils::SetNonBlocking(sig_chld_fds_[1]); | 147 FDUtils::SetNonBlocking(sig_chld_fds_[1]); |
| 148 | 148 |
| 149 // Thread started and the ExitCodeHandler is initialized. | 149 // Thread started and the ExitCodeHandler is initialized. |
| 150 initialized_ = true; | 150 initialized_ = true; |
| 151 return true; | 151 return true; |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Get the write end of the pipe. | 154 // Get the write end of the pipe. |
| 155 static int WakeUpFd() { | 155 static int WakeUpFd() { |
| 156 ASSERT(initialized_); | |
| 157 return sig_chld_fds_[1]; | 156 return sig_chld_fds_[1]; |
| 158 } | 157 } |
| 159 | 158 |
| 160 static void TerminateExitCodeThread() { | 159 static void TerminateExitCodeThread() { |
| 161 MutexLocker locker(mutex_); | 160 MutexLocker locker(mutex_); |
| 162 if (!initialized_) { | 161 if (!initialized_) { |
| 163 return; | 162 return; |
| 164 } | 163 } |
| 165 | 164 |
| 166 uint8_t data = kThreadTerminateByte; | 165 uint8_t data = kThreadTerminateByte; |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 696 |
| 698 | 697 |
| 699 intptr_t Process::CurrentProcessId() { | 698 intptr_t Process::CurrentProcessId() { |
| 700 return static_cast<intptr_t>(getpid()); | 699 return static_cast<intptr_t>(getpid()); |
| 701 } | 700 } |
| 702 | 701 |
| 703 } // namespace bin | 702 } // namespace bin |
| 704 } // namespace dart | 703 } // namespace dart |
| 705 | 704 |
| 706 #endif // defined(TARGET_OS_ANDROID) | 705 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |