Fix result of Scheduler::Run() with empty work queue
Scheduler::Run() should return true on success, not false.
This causes failures after
commit 9673115bc14c8630da5b7f6fe07e0b362ac49dcb which introduces a
pattern where g_scheduler->Run() is called in cases where there might
not be any scheduled tasks.
Bug: 475707985
Change-Id: I0a3f17d717ccfb68bbf604b2589bc286d3a948a4
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/20840
Commit-Queue: Andrew Grieve <agrieve@google.com>
Reviewed-by: Andrew Grieve <agrieve@google.com>
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@google.com>
diff --git a/src/gn/scheduler.cc b/src/gn/scheduler.cc
index a72aed2..655eb36 100644
--- a/src/gn/scheduler.cc
+++ b/src/gn/scheduler.cc
@@ -33,7 +33,7 @@
// Flush any posted tasks (that were posted from the UI thread).
main_thread_run_loop_->PostQuit();
main_thread_run_loop_->Run();
- return is_failed_;
+ return !is_failed_;
}
has_been_shutdown_ = false;