Internal change
PiperOrigin-RevId: 539220863
This commit is contained in:
		
							parent
							
								
									53f0736bf0
								
							
						
					
					
						commit
						1d4a205c2e
					
				|  | @ -839,6 +839,10 @@ absl::Status CalculatorGraph::PrepareForRun( | |||
| } | ||||
| 
 | ||||
| absl::Status CalculatorGraph::WaitUntilIdle() { | ||||
|   if (has_sources_) { | ||||
|     LOG(WARNING) << "WaitUntilIdle called on a graph with source nodes, which " | ||||
|                     "is not fully supported at the moment."; | ||||
|   } | ||||
|   MP_RETURN_IF_ERROR(scheduler_.WaitUntilIdle()); | ||||
|   VLOG(2) << "Scheduler idle."; | ||||
|   absl::Status status = absl::OkStatus(); | ||||
|  |  | |||
|  | @ -229,8 +229,11 @@ class CalculatorGraph { | |||
|   // Wait until the running graph is in the idle mode, which is when nothing can
 | ||||
|   // be scheduled and nothing is running in the worker threads. This function
 | ||||
|   // can be called only after StartRun().
 | ||||
|   //
 | ||||
|   // NOTE: The graph must not have any source nodes because source nodes prevent
 | ||||
|   // the running graph from becoming idle until the source nodes are done.
 | ||||
|   // Currently, `WaitUntilIdle` cannot be used reliably on graphs with any
 | ||||
|   // source nodes.
 | ||||
|   absl::Status WaitUntilIdle(); | ||||
| 
 | ||||
|   // Wait until a packet is emitted on one of the observed output streams.
 | ||||
|  |  | |||
|  | @ -273,8 +273,8 @@ absl::Status Scheduler::WaitForObservedOutput() { | |||
| // 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 allow WaitUntilIdle() to be called on a graph with
 | ||||
| // no source nodes. (This is enforced by CalculatorGraph::WaitUntilIdle().)
 | ||||
| // 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() { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user