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

Unified Diff: runtime/vm/message_handler.h

Issue 46173002: - Make sure to keep the main/control port opened until the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/vm/message_handler.h
===================================================================
--- runtime/vm/message_handler.h (revision 29277)
+++ runtime/vm/message_handler.h (working copy)
@@ -53,8 +53,15 @@
// Returns true on success.
bool HandleOOBMessages();
+ // The number of opened control ports is determined whether the isolate has
+ // live ports. An isolate is considered not having any live ports if only
+ // control ports are open.
+ // Usually either 0 or 1.
+ void increment_control_ports();
+ void decrement_control_ports();
+
// A message handler tracks how many live ports it has.
- bool HasLivePorts() const { return live_ports_ > 0; }
+ bool HasLivePorts() const { return live_ports_ > control_ports_; }
#if defined(DEBUG)
// Check that it is safe to access this message handler.
@@ -120,7 +127,8 @@
Monitor monitor_; // Protects all fields in MessageHandler.
MessageQueue* queue_;
MessageQueue* oob_queue_;
- intptr_t live_ports_;
+ intptr_t control_ports_; // The number of open control ports usually 0 or 1.
+ intptr_t live_ports_; // The number of open ports, including control ports.
ThreadPool* pool_;
ThreadPool::Task* task_;
StartCallback start_callback_;

Powered by Google App Engine
This is Rietveld 408576698