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

Unified Diff: mojo/public/cpp/utility/lib/run_loop.cc

Issue 1825553002: Properly "handle" MOJO_RESULT_BUSY in a few flaces. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 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/public/cpp/system/wait.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/utility/lib/run_loop.cc
diff --git a/mojo/public/cpp/utility/lib/run_loop.cc b/mojo/public/cpp/utility/lib/run_loop.cc
index f5547201e1c3f30f836d2f1d71c99b0137f22e95..f68ad79a08917b9928eba8716baa494c57d6ed2a 100644
--- a/mojo/public/cpp/utility/lib/run_loop.cc
+++ b/mojo/public/cpp/utility/lib/run_loop.cc
@@ -169,6 +169,11 @@ bool RunLoop::Wait(bool non_blocking) {
handler->OnHandleReady(handle);
return true;
case MOJO_RESULT_INVALID_ARGUMENT:
+ case MOJO_RESULT_CANCELLED:
+ case MOJO_RESULT_BUSY:
+ // These results indicate a bug in "our" code (e.g., race conditions).
+ assert(false);
+ // Fall through.
case MOJO_RESULT_FAILED_PRECONDITION:
// Remove the handle first, this way if OnHandleError() tries to remove
// the handle our iterator isn't invalidated.
« no previous file with comments | « mojo/public/cpp/system/wait.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698