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

Unified Diff: runtime/bin/eventhandler_android.cc

Issue 83963003: Removes EPOLLONESHOT from Android eventhandler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_android.cc
===================================================================
--- runtime/bin/eventhandler_android.cc (revision 30595)
+++ runtime/bin/eventhandler_android.cc (working copy)
@@ -74,9 +74,6 @@
event.events = sd->GetPollEvents();
event.data.ptr = sd;
if (sd->port() != 0 && event.events != 0) {
- // Only report events once and wait for them to be re-enabled after the
- // event has been handled by the Dart code.
- event.events |= EPOLLONESHOT;
int status = 0;
if (sd->tracked_by_epoll()) {
status = TEMP_FAILURE_RETRY(epoll_ctl(epoll_fd_,
@@ -341,10 +338,11 @@
} else {
SocketData* sd = reinterpret_cast<SocketData*>(events[i].data.ptr);
intptr_t event_mask = GetPollEvents(events[i].events, sd);
- if (event_mask == 0) {
- // Event not handled, re-add to epoll.
- UpdateEpollInstance(epoll_fd_, sd);
- } else {
+ if (event_mask != 0) {
+ // Unregister events for the file descriptor. Events will be
+ // registered again when the current event has been handled in
+ // Dart code.
+ RemoveFromEpollInstance(epoll_fd_, sd);
Dart_Port port = sd->port();
ASSERT(port != 0);
DartUtils::PostInt32(port, event_mask);
@@ -400,9 +398,8 @@
if (errno != EWOULDBLOCK) {
perror("Poll failed");
}
- } else if (result == 0) {
- handler->HandleTimeout();
} else {
+ handler->HandleTimeout();
handler->HandleEvents(events, result);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698