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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 174033002: Add missing mutex protection for timeout queue with mutex (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a couple of ASSERTs Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 73f2947db7d90f02d2c8f8905a1dd2a86caee36a..a7a1049203df9580db8619755e7eab9fc6148681 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -131,13 +131,16 @@ void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
int size) {
for (int i = 0; i < size; i++) {
uint64_t data = events[i].data.u64;
+ // ILLEGAL_PORT is used to identify timer-fd.
if (data == ILLEGAL_PORT) {
int64_t val;
VOID_TEMP_FAILURE_RETRY(read(timer_fd_, &val, sizeof(val)));
+ timer_mutex_.Lock();
if (timeout_queue_.HasTimeout()) {
DartUtils::PostNull(timeout_queue_.CurrentPort());
timeout_queue_.RemoveCurrent();
}
+ timer_mutex_.Unlock();
} else {
int32_t event_mask = GetPollEvents(events[i].events);
if (event_mask != 0) {
« no previous file with comments | « runtime/bin/eventhandler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698