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

Unified Diff: mojo/system/handle_table.cc

Issue 407643002: Mojo: In Debug builds, log when a race condition in user code is likely observed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: mojo/system/handle_table.cc
diff --git a/mojo/system/handle_table.cc b/mojo/system/handle_table.cc
index 2e4d22a98244ab6517e57c69949160e4bca3e6e1..9ab2d24d20b4c9c544106568ee32240c0d9f6979 100644
--- a/mojo/system/handle_table.cc
+++ b/mojo/system/handle_table.cc
@@ -146,6 +146,13 @@ MojoResult HandleTable::MarkBusyAndStartTransport(
Dispatcher::HandleTableAccess::TryStartTransport(
entries[i]->dispatcher.get());
if (!transport.is_valid()) {
+ // Only log for Debug builds, since this is not a problem with the system
+ // code, but with user code.
+ DLOG(WARNING) << "Likely race condition in user code detected: attempt "
+ "to transfer handle "
+ << handles[i]
+ << " while it is in use on a different thread";
+
// Unset the busy flag (since it won't be unset below).
entries[i]->busy = false;
error_result = MOJO_RESULT_BUSY;
« 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