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

Unified Diff: runtime/vm/message.h

Issue 9570051: Revert my last change. Odd test failures that I will investigate tomorrow. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/vm/isolate.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message.h
===================================================================
--- runtime/vm/message.h (revision 4842)
+++ runtime/vm/message.h (working copy)
@@ -67,16 +67,26 @@
void Enqueue(Message* msg);
- // Gets the next message from the message queue if available.
- // Returns NULL if no message is available.
- Message* Dequeue();
+ // Gets the next message from the message queue, possibly blocking
+ // if no message is available. 'millis' is a timeout in
+ // milliseconds. If 'millis' is 0, then this means to block
+ // indefinitely. May block if no message is available. May return
+ // NULL even if 'millis' is 0 due to spurious wakeups.
+ Message* Dequeue(int64_t millis);
+ // Gets the next message from the message queue if available. Will
+ // not block.
+ Message* DequeueNoWait();
+
void Flush(Dart_Port port);
void FlushAll();
private:
friend class MessageQueueTestPeer;
+ Message* DequeueNoWaitHoldsLock();
+
+ Monitor monitor_;
Message* head_[Message::kNumPriorities];
Message* tail_[Message::kNumPriorities];
@@ -86,11 +96,12 @@
// A MessageHandler is an entity capable of accepting messages.
class MessageHandler {
protected:
+ MessageHandler();
+
// Allows subclasses to provide custom message notification.
virtual void MessageNotify(Message::Priority priority);
public:
- MessageHandler();
virtual ~MessageHandler();
// Allow subclasses to provide a handler name.
@@ -109,17 +120,6 @@
void ClosePort(Dart_Port port);
void CloseAllPorts();
- // Gets the next message from the message queue, possibly blocking
- // if no message is available. 'millis' is a timeout in
- // milliseconds. If 'millis' is 0, then this means to block
- // indefinitely. May block if no message is available. May return
- // NULL even if 'millis' is 0 due to spurious wakeups.
- Message* Dequeue(int64_t millis);
-
- // Gets the next message from the message queue if available. Will
- // not block.
- Message* DequeueNoWait();
-
// A message handler tracks how many live ports it has.
bool HasLivePorts() const { return live_ports_ > 0; }
void increment_live_ports() {
@@ -140,10 +140,9 @@
// This is used to delete handlers when their last live port is closed.
virtual bool OwnedByPortMap() const { return false; }
- private:
- friend class MessageHandlerTestPeer;
+ MessageQueue* queue() const { return queue_; }
- Monitor monitor_;
+ private:
intptr_t live_ports_;
MessageQueue* queue_;
};
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698