Mojo: In Debug builds, log when a race condition in user code is likely observed.

Probably, we should also do something (assert/DCHECK) in the bindings
code too, but I'll do that separately.

R=darin@chromium.org
BUG=389666

Review URL: https://codereview.chromium.org/407643002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284934 0039d316-1c4b-4281-b951-d872f2087c98
parent 41c0d7c1
...@@ -146,6 +146,13 @@ MojoResult HandleTable::MarkBusyAndStartTransport( ...@@ -146,6 +146,13 @@ MojoResult HandleTable::MarkBusyAndStartTransport(
Dispatcher::HandleTableAccess::TryStartTransport( Dispatcher::HandleTableAccess::TryStartTransport(
entries[i]->dispatcher.get()); entries[i]->dispatcher.get());
if (!transport.is_valid()) { 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). // Unset the busy flag (since it won't be unset below).
entries[i]->busy = false; entries[i]->busy = false;
error_result = MOJO_RESULT_BUSY; error_result = MOJO_RESULT_BUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment