| 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 <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
| 10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL)); | 150 status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL)); |
| 151 if (status == -1) { | 151 if (status == -1) { |
| 152 FATAL1("Failed adding listener socket to kqueue: %s\n", strerror(errno)); | 152 FATAL1("Failed adding listener socket to kqueue: %s\n", strerror(errno)); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 | 156 |
| 157 void DebuggerConnectionImpl::StartHandler(int port_number) { | 157 void DebuggerConnectionImpl::StartHandler(int port_number) { |
| 158 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); | 158 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); |
| 159 SetupPollQueue(); | 159 SetupPollQueue(); |
| 160 int result = | 160 int result = dart::Thread::Start(&DebuggerConnectionImpl::Handler, 0); |
| 161 dart::Thread::Start(&DebuggerConnectionImpl::Handler, 0); | |
| 162 if (result != 0) { | 161 if (result != 0) { |
| 163 FATAL1("Failed to start debugger connection handler thread: %d\n", result); | 162 FATAL1("Failed to start debugger connection handler thread: %d\n", result); |
| 164 } | 163 } |
| 165 } | 164 } |
| 166 | 165 |
| 167 | 166 |
| 168 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, | 167 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, |
| 169 const char* buf, | 168 const char* buf, |
| 170 int len) { | 169 int len) { |
| 171 return TEMP_FAILURE_RETRY(write(socket, buf, len)); | 170 return TEMP_FAILURE_RETRY(write(socket, buf, len)); |
| 172 } | 171 } |
| 173 | 172 |
| 174 | 173 |
| 175 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 174 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
| 176 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 175 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
| 177 } | 176 } |
| 178 | 177 |
| 179 } // namespace bin | 178 } // namespace bin |
| 180 } // namespace dart | 179 } // namespace dart |
| 181 | 180 |
| 182 #endif // defined(TARGET_OS_MACOS) | 181 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |