]> 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:12:03 +0000 (09:12 +0000)
committermkr <mkr@opencascade.com>
Tue, 31 Jan 2006 09:12:03 +0000 (09:12 +0000)
src/Supervision/Graph_Impl.cxx

index dd0df077aaca30549036e939e2f00cf22c2b502e..cc57cb5fd296ba7b753da89ffd8e226347b55cee 100644 (file)
@@ -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") ;