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; |