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

Unified Diff: mojo/message_pump/message_pump_mojo.h

Issue 1566573002: Fix race on mojo message pump shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-waitset-message-pump
Patch Set: Revert stuff. Created 4 years, 11 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 | « mojo/message_pump/handle_watcher.cc ('k') | mojo/message_pump/message_pump_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/message_pump/message_pump_mojo.h
diff --git a/mojo/message_pump/message_pump_mojo.h b/mojo/message_pump/message_pump_mojo.h
index 345bdb6bbd26b378b6a8736c6a7cc8d52454279a..026eb288f4d310201aa9a5296e0105b2f12865bb 100644
--- a/mojo/message_pump/message_pump_mojo.h
+++ b/mojo/message_pump/message_pump_mojo.h
@@ -15,6 +15,7 @@
#include "base/message_loop/message_pump.h"
#include "base/observer_list.h"
#include "base/synchronization/lock.h"
+#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "mojo/message_pump/mojo_message_pump_export.h"
#include "mojo/public/cpp/system/core.h"
@@ -93,6 +94,8 @@ class MOJO_MESSAGE_PUMP_EXPORT MessagePumpMojo : public base::MessagePump {
// handle has become ready, |false| otherwise.
bool DoInternalWork(const RunState& run_state, bool block);
+ bool DoNonMojoWork(const RunState& run_state, bool block);
+
// Waits for handles in the wait set to become ready. Returns |true| if ready
// handles may be available, or |false| if the wait's deadline was exceeded.
// Note, ready handles may be unavailable, even though |true| was returned.
@@ -154,6 +157,10 @@ class MOJO_MESSAGE_PUMP_EXPORT MessagePumpMojo : public base::MessagePump {
ScopedMessagePipeHandle read_handle_;
ScopedMessagePipeHandle write_handle_;
+ // Used to sleep until there is more work to do, when the Mojo EDK is shutting
+ // down.
+ base::WaitableEvent event_;
+
DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo);
};
« no previous file with comments | « mojo/message_pump/handle_watcher.cc ('k') | mojo/message_pump/message_pump_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698