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

Unified Diff: runtime/vm/message_handler.h

Issue 1758503002: Make the lock/unlock and Enter/Exit methods in Mutex and Monitor private so taht we always use the … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review-comments Created 4 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 | « no previous file | runtime/vm/message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message_handler.h
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index 6f0132899fe683ccb7aaa080a2e7825b2e4f38c3..1d039c5b840d83c274553aa6884ac4f31ab59e6e 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -6,15 +6,13 @@
#define VM_MESSAGE_HANDLER_H_
#include "vm/isolate.h"
+#include "vm/lockers.h"
#include "vm/message.h"
#include "vm/os_thread.h"
#include "vm/thread_pool.h"
namespace dart {
-// Forward declarations.
-class MonitorLocker;
-
// A MessageHandler is an entity capable of accepting messages.
class MessageHandler {
protected:
@@ -122,9 +120,12 @@ class MessageHandler {
void PausedOnStart(bool paused);
void PausedOnExit(bool paused);
+ // Gives temporary ownership of |queue| and |oob_queue|. Using this object
+ // has the side effect that no OOB messages will be handled if a stack
+ // overflow interrupt is delivered.
class AcquiredQueues : public ValueObject {
public:
- AcquiredQueues();
+ explicit AcquiredQueues(MessageHandler* handler);
~AcquiredQueues();
@@ -143,18 +144,12 @@ class MessageHandler {
}
private:
- void Reset(MessageHandler* handler);
-
MessageHandler* handler_;
+ SafepointMonitorLocker ml_;
friend class MessageHandler;
};
- // Gives temporary ownership of |queue| and |oob_queue|. Calling this
- // has the side effect that no OOB messages will be handled if a stack
- // overflow interrupt is delivered.
- void AcquireQueues(AcquiredQueues* acquired_queue);
-
#if defined(DEBUG)
// Check that it is safe to access this message handler.
//
@@ -218,8 +213,8 @@ class MessageHandler {
// NOTE: These two functions release and reacquire the monitor, you may
// need to call HandleMessages to ensure all pending messages are handled.
- void PausedOnStartLocked(bool paused);
- void PausedOnExitLocked(bool paused);
+ void PausedOnStartLocked(MonitorLocker* ml, bool paused);
+ void PausedOnExitLocked(MonitorLocker* ml, bool paused);
// Dequeue the next message. Prefer messages from the oob_queue_ to
// messages from the queue_.
« no previous file with comments | « no previous file | runtime/vm/message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698