| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 | 695 |
| 697 | 696 |
| 698 intptr_t Process::CurrentProcessId() { | 697 intptr_t Process::CurrentProcessId() { |
| 699 return static_cast<intptr_t>(getpid()); | 698 return static_cast<intptr_t>(getpid()); |
| 700 } | 699 } |
| 701 | 700 |
| 702 } // namespace bin | 701 } // namespace bin |
| 703 } // namespace dart | 702 } // namespace dart |
| 704 | 703 |
| 705 #endif // defined(TARGET_OS_LINUX) | 704 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |