Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: runtime/bin/eventhandler_macos.cc

Issue 9212041: Add extra debug information when failing to deliver an interrupt message. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updating linux and mac test binaries. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | tools/testing/bin/linux/dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void EventHandlerImplementation::WakeupHandler(intptr_t id, 88 void EventHandlerImplementation::WakeupHandler(intptr_t id,
89 Dart_Port dart_port, 89 Dart_Port dart_port,
90 int64_t data) { 90 int64_t data) {
91 InterruptMessage msg; 91 InterruptMessage msg;
92 msg.id = id; 92 msg.id = id;
93 msg.dart_port = dart_port; 93 msg.dart_port = dart_port;
94 msg.data = data; 94 msg.data = data;
95 intptr_t result = 95 intptr_t result =
96 FDUtils::WriteToBlocking(interrupt_fds_[1], &msg, kInterruptMessageSize); 96 FDUtils::WriteToBlocking(interrupt_fds_[1], &msg, kInterruptMessageSize);
97 if (result != kInterruptMessageSize) { 97 if (result != kInterruptMessageSize) {
98 FATAL("Interrupt message failure"); 98 if (result == -1) {
99 perror("Interrupt message failure:");
100 }
101 FATAL1("Interrupt message failure. Wrote %d bytes.", result);
99 } 102 }
100 } 103 }
101 104
102 105
103 struct pollfd* EventHandlerImplementation::GetPollFds(intptr_t* pollfds_size) { 106 struct pollfd* EventHandlerImplementation::GetPollFds(intptr_t* pollfds_size) {
104 struct pollfd* pollfds; 107 struct pollfd* pollfds;
105 108
106 // Calculate the number of file descriptors to poll on. 109 // Calculate the number of file descriptors to poll on.
107 intptr_t numPollfds = 1; 110 intptr_t numPollfds = 1;
108 for (HashMap::Entry* entry = socket_map_.Start(); 111 for (HashMap::Entry* entry = socket_map_.Start();
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { 383 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
381 // The hashmap does not support keys with value 0. 384 // The hashmap does not support keys with value 0.
382 return reinterpret_cast<void*>(fd + 1); 385 return reinterpret_cast<void*>(fd + 1);
383 } 386 }
384 387
385 388
386 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 389 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
387 // The hashmap does not support keys with value 0. 390 // The hashmap does not support keys with value 0.
388 return dart::Utils::WordHash(fd + 1); 391 return dart::Utils::WordHash(fd + 1);
389 } 392 }
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | tools/testing/bin/linux/dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698