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

Unified Diff: third_party/mojo/src/mojo/edk/system/channel.cc

Issue 1367383002: Set |Channel::is_shutting_down_| during channel shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/mojo/src/mojo/edk/system/channel.cc
diff --git a/third_party/mojo/src/mojo/edk/system/channel.cc b/third_party/mojo/src/mojo/edk/system/channel.cc
index 263f40b1473155c719fd773d689113d08ab023f7..1b46721ace2ce724b43e8c72f6798daf64b46cd8 100644
--- a/third_party/mojo/src/mojo/edk/system/channel.cc
+++ b/third_party/mojo/src/mojo/edk/system/channel.cc
@@ -69,6 +69,10 @@ void Channel::Shutdown() {
// |OnReadMessage()| or |OnError()|.
raw_channel_->Shutdown();
is_running_ = false;
+ // |WillShutdownSoon()| may not have been called (i.e. on a channel error),
+ // and this flag is relied on to prevent a race with
+ // |AttachAndRunEndpoint()|.
+ is_shutting_down_ = true;
// We need to deal with it outside the lock.
std::swap(to_destroy, local_id_to_endpoint_map_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698