| 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_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Mark write end non-blocking. | 144 // Mark write end non-blocking. |
| 145 FDUtils::SetNonBlocking(sig_chld_fds_[1]); | 145 FDUtils::SetNonBlocking(sig_chld_fds_[1]); |
| 146 | 146 |
| 147 // Thread started and the ExitCodeHandler is initialized. | 147 // Thread started and the ExitCodeHandler is initialized. |
| 148 initialized_ = true; | 148 initialized_ = true; |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 | 151 |
| 152 // Get the write end of the pipe. | 152 // Get the write end of the pipe. |
| 153 static int WakeUpFd() { | 153 static int WakeUpFd() { |
| 154 ASSERT(initialized_); | |
| 155 return sig_chld_fds_[1]; | 154 return sig_chld_fds_[1]; |
| 156 } | 155 } |
| 157 | 156 |
| 158 static void TerminateExitCodeThread() { | 157 static void TerminateExitCodeThread() { |
| 159 MutexLocker locker(mutex_); | 158 MutexLocker locker(mutex_); |
| 160 if (!initialized_) { | 159 if (!initialized_) { |
| 161 return; | 160 return; |
| 162 } | 161 } |
| 163 | 162 |
| 164 uint8_t data = kThreadTerminateByte; | 163 uint8_t data = kThreadTerminateByte; |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 700 |
| 702 | 701 |
| 703 intptr_t Process::CurrentProcessId() { | 702 intptr_t Process::CurrentProcessId() { |
| 704 return static_cast<intptr_t>(getpid()); | 703 return static_cast<intptr_t>(getpid()); |
| 705 } | 704 } |
| 706 | 705 |
| 707 } // namespace bin | 706 } // namespace bin |
| 708 } // namespace dart | 707 } // namespace dart |
| 709 | 708 |
| 710 #endif // defined(TARGET_OS_MACOS) | 709 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |