]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Fix for bug IPAL11408 : "Run()" method returns "0" after trying to start graph execution.
authormkr <mkr@opencascade.com>
Tue, 31 Jan 2006 09:10:53 +0000 (09:10 +0000)
committermkr <mkr@opencascade.com>
Tue, 31 Jan 2006 09:10:53 +0000 (09:10 +0000)
src/Supervision/Graph_Impl.cxx

index 266ec26ca6298dc414a974a77354095a66e0ee2f..8153f5aa699188caa82da00f3d1bb6be3b86f2c6 100644 (file)
@@ -1808,6 +1808,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") ;