From da0d472a794a7f39307707da93c39f216f88e5bb Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 31 Jan 2006 09:12:03 +0000 Subject: [PATCH] Fix for bug IPAL11408 : "Run()" method returns "0" after trying to start graph execution. --- src/Supervision/Graph_Impl.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Supervision/Graph_Impl.cxx b/src/Supervision/Graph_Impl.cxx index dd0df07..cc57cb5 100644 --- a/src/Supervision/Graph_Impl.cxx +++ b/src/Supervision/Graph_Impl.cxx @@ -1764,6 +1764,13 @@ long Graph_Impl::SuspendedThreads() { bool Graph_Impl::Begin() { bool RetVal = false ; + // mkr : IPAL11408 : "Run()" method returns "0" after trying to start graph execution. + // If we call Run() method from Python script two times for one graph, we have to be sure, + // that first execution of this graph ended (i.e. GraphEditor::DataFlow::Editing() method was called). + // Otherwise, the second call of Run() method will return 0. Therefore, we have to waiting for + // the first execution finish. + // NB! From GUI we cann't run dataflow if its previous execution not finished. + while ( !DataFlowEditor()->IsEditing() ) {} // waiting for the previous execution of this graph ended if ( DataFlowEditor()->IsEditing() ) { if ( pthread_mutex_lock( &_MutexExecutorWait ) ) { perror("pthread_mutex_lock _MutexExecutorWait") ; -- 2.39.2