From: mkr Date: Tue, 31 Jan 2006 09:12:03 +0000 (+0000) Subject: Fix for bug IPAL11408 : "Run()" method returns "0" after trying to start graph execution. X-Git-Tag: T2_2_9pre~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da0d472a794a7f39307707da93c39f216f88e5bb;p=modules%2Fsuperv.git Fix for bug IPAL11408 : "Run()" method returns "0" after trying to start graph execution. --- 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") ;