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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 22901017: Always initialize the EventHandler in the standalone. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify impl and don't call Stop (other isolates may still be running). Created 7 years, 4 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
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 6d15c9efaeb3f3b3159769e0a9c2b1334baf1c42..e95def62e03fac42e76faef28f8767d2b4110b68 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -165,6 +165,9 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
msg.id = id;
msg.dart_port = dart_port;
msg.data = data;
+ // WriteToBlocking will write up to 512 bytes atomically, and since our msg
+ // is smaller than 512, we don't need a thread lock.
+ // See: http://linux.die.net/man/7/pipe, section 'Pipe_buf'.
Ivan Posva 2013/08/23 00:14:16 You should probably ASSERT(kInterruptMessageSize <
Anders Johnsen 2013/08/23 05:15:27 Good idea.
intptr_t result =
FDUtils::WriteToBlocking(interrupt_fds_[1], &msg, kInterruptMessageSize);
if (result != kInterruptMessageSize) {

Powered by Google App Engine
This is Rietveld 408576698