No public description

PiperOrigin-RevId: 555005770
This commit is contained in:
MediaPipe Team 2023-08-08 18:36:05 -07:00 committed by Copybara-Service
parent e558a71597
commit f9a0244c5b
2 changed files with 10 additions and 7 deletions

View File

@ -270,13 +270,6 @@ absl::Status Scheduler::WaitForObservedOutput() {
return observed ? absl::OkStatus() : absl::OutOfRangeError("Graph is done.");
}
// Idleness requires:
// 1. either the graph has no source nodes or all source nodes are closed, and
// 2. no packets are added to graph input streams.
// For simplicity, we only fully support WaitUntilIdle() to be called on a graph
// with no source nodes.
// The application must ensure no other threads are adding packets to graph
// input streams while a WaitUntilIdle() call is in progress.
absl::Status Scheduler::WaitUntilIdle() {
RET_CHECK_NE(state_, STATE_NOT_STARTED);
ApplicationThreadAwait(std::bind(&Scheduler::IsIdle, this));

View File

@ -76,6 +76,16 @@ class Scheduler {
// be scheduled and nothing is running in the worker threads. This function
// can be called only after Start().
// Runs application thread tasks while waiting.
//
// Idleness requires:
// 1. either the graph has no source nodes or all source nodes are closed, and
// 2. no packets are added to graph input streams.
//
// For simplicity, we only fully support WaitUntilIdle() to be called on a
// graph with no source nodes.
//
// The application must ensure no other threads are adding packets to graph
// input streams while a WaitUntilIdle() call is in progress.
absl::Status WaitUntilIdle() ABSL_LOCKS_EXCLUDED(state_mutex_);
// Wait until any graph input stream has been unthrottled.