| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <poll.h> | 6 #include <poll.h> |
| 7 #include <pthread.h> | 7 #include <pthread.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/time.h> | 10 #include <sys/time.h> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 #ifdef DEBUG_POLL | 195 #ifdef DEBUG_POLL |
| 196 static void PrintEventMask(struct pollfd* pollfd) { | 196 static void PrintEventMask(struct pollfd* pollfd) { |
| 197 printf("%d ", pollfd->fd); | 197 printf("%d ", pollfd->fd); |
| 198 if ((pollfd->revents & POLLIN) != 0) printf("POLLIN "); | 198 if ((pollfd->revents & POLLIN) != 0) printf("POLLIN "); |
| 199 if ((pollfd->revents & POLLPRI) != 0) printf("POLLPRI "); | 199 if ((pollfd->revents & POLLPRI) != 0) printf("POLLPRI "); |
| 200 if ((pollfd->revents & POLLOUT) != 0) printf("POLLOUT "); | 200 if ((pollfd->revents & POLLOUT) != 0) printf("POLLOUT "); |
| 201 if ((pollfd->revents & POLLERR) != 0) printf("POLLERR "); | 201 if ((pollfd->revents & POLLERR) != 0) printf("POLLERR "); |
| 202 if ((pollfd->revents & POLLHUP) != 0) printf("POLLHUP "); | 202 if ((pollfd->revents & POLLHUP) != 0) printf("POLLHUP "); |
| 203 if ((pollfd->revents & POLLRDHUP) != 0) printf("POLLRDHUP "); | |
| 204 if ((pollfd->revents & POLLNVAL) != 0) printf("POLLNVAL "); | 203 if ((pollfd->revents & POLLNVAL) != 0) printf("POLLNVAL "); |
| 205 int all_events = POLLIN | POLLPRI | POLLOUT | | 204 int all_events = POLLIN | POLLPRI | POLLOUT | POLLERR | POLLHUP | POLLNVAL; |
| 206 POLLERR | POLLHUP | POLLRDHUP | POLLNVAL; | |
| 207 if ((pollfd->revents & ~all_events) != 0) { | 205 if ((pollfd->revents & ~all_events) != 0) { |
| 208 printf("(and %08x) ", pollfd->revents & ~all_events); | 206 printf("(and %08x) ", pollfd->revents & ~all_events); |
| 209 } | 207 } |
| 210 printf("(available %d) ", FDUtils::AvailableBytes(pollfd->fd)); | 208 printf("(available %d) ", FDUtils::AvailableBytes(pollfd->fd)); |
| 211 | 209 |
| 212 printf("\n"); | 210 printf("\n"); |
| 213 } | 211 } |
| 214 #endif | 212 #endif |
| 215 | 213 |
| 216 intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) { | 214 intptr_t EventHandlerImplementation::GetPollEvents(struct pollfd* pollfd) { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 FATAL("Create start event handler thread"); | 367 FATAL("Create start event handler thread"); |
| 370 } | 368 } |
| 371 } | 369 } |
| 372 | 370 |
| 373 | 371 |
| 374 void EventHandlerImplementation::SendData(intptr_t id, | 372 void EventHandlerImplementation::SendData(intptr_t id, |
| 375 Dart_Port dart_port, | 373 Dart_Port dart_port, |
| 376 intptr_t data) { | 374 intptr_t data) { |
| 377 WakeupHandler(id, dart_port, data); | 375 WakeupHandler(id, dart_port, data); |
| 378 } | 376 } |
| OLD | NEW |