Control of execution of Inline nodes - does not work (Kill, Suspend, Resume), because it was implemented using signals, that were caught and handled in Container.
}
else {
// Now we can suspend an InLineNode with the handler of the SuperVision Container
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ; RetVal = false;
+ cdebug << "Suspend of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Suspend of InLine nodes is NOT implemented." );
+ /*
if ( pthread_kill( _OutNode->MainThreadId() , SIGUSR2 ) == -1 ) {
perror("Suspend pthread_kill error") ;
State( GraphExecutor::ErroredState ) ;
<< endl ;
}
}
+ */
}
}
else {
else {
//PAL6886
// Now we can kill an InLineNode with the handler of the SuperVision Container
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ cdebug << "Kill of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Kill of InLine nodes is NOT implemented." );
+ /*
cdebug << pthread_self() << "Kill of InLineNode " << Name() << " MainThreadId "
<< _OutNode->MainThreadId() << " :" << endl ;
MESSAGE( pthread_self() << "Kill of InLineNode " << Name() << " MainThreadId "
<< " done. MainThreadId " << _OutNode->MainThreadId() ) ;
RetVal = true ;
}
+ */
}
}
else if ( IsSuspended() ) {
}
else {
// Resume of InLinePythonNode in the Node of the SuperVisionContainer ...
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ cdebug << "Resume of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Resume of InLine nodes is NOT implemented." );
+ /*
cdebug << ThreadNo() << "/" << pthread_self()
<< "Resume of InLineNode pthread_kill" << Name() << endl ;
if ( pthread_kill( _OutNode->MainThreadId() , SIGCONT ) == -1 ) {
State( GraphExecutor::ExecutingState ) ;
RetVal = true ;
}
+ */
}
}
else if ( State() == GraphExecutor::SuspendedSuccessedState ) {
#include "DataFlowEditor_DataFlow.hxx"
-extern Engines_Container_i * _TheContainer ;
+// asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+//extern Engines_Container_i * _TheContainer ;
extern GraphExecutor::FiniteStateMachine * theAutomaton ;
GraphExecutor::OutNode::OutNode() {
// Graph() {
- _SuperVisionContainer = _TheContainer ;
- _MainThreadId = SuperVisionContainer()->MainThreadId() ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
_prof_debug , _fdebug ) ;
_Graph = _StreamGraph ;
}
- _SuperVisionContainer = _TheContainer ;
- _MainThreadId = SuperVisionContainer()->MainThreadId() ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
_prof_debug , _fdebug ) ;
_Graph = _StreamGraph ;
}
- _SuperVisionContainer = _TheContainer ;
- _MainThreadId = SuperVisionContainer()->MainThreadId() ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
if ( !Py_IsInitialized() ) {
// PyEval_InitThreads() ;
// Py_Initialize() ;
-// PySys_SetArgv( _ArgC , _ArgV ) ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ // 1 line below uncommented
+ PySys_SetArgv( _ArgC , _ArgV ) ;
}
anInNode->InitPython() ;
PyInitialized( true ) ;
<< _SuspendedThreads << " EventQSize " << EventQSize() << endl ;
}
-Engines_Container_i * GraphExecutor::OutNode::SuperVisionContainer() {
- return _SuperVisionContainer ;
-}
+// asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+//Engines_Container_i * GraphExecutor::OutNode::SuperVisionContainer() {
+// return _SuperVisionContainer ;
+//}
-const pthread_t GraphExecutor::OutNode::MainThreadId() const {
- return _MainThreadId ;
-}
+//const pthread_t GraphExecutor::OutNode::MainThreadId() const {
+// return _MainThreadId ;
+//}
void GraphExecutor::OutNode::PThreadLock( pthread_mutex_t * aMutex , char * errmsg ) {
// if ( strcmp( errmsg , "EventLoop" ) && strcmp( errmsg , "EventW" ) ) {
SUPERV::ControlState _ControlState ;
bool _Done ;
- Engines_Container_i * _SuperVisionContainer ;
- pthread_t _MainThreadId ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Engines_Container_i * _SuperVisionContainer ;
+ //pthread_t _MainThreadId ;
pthread_mutex_t _PyMutexWait ;
pthread_mutex_t _MutexWait ;
pthread_cond_t _EventWait ;
void CheckAllDone() ;
- Engines_Container_i * SuperVisionContainer() ;
- const pthread_t MainThreadId() const ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Engines_Container_i * SuperVisionContainer() ;
+ //const pthread_t MainThreadId() const ;
void PThreadLock( pthread_mutex_t * aMutex , char * errmsg ) ;
void PThreadUnLock( pthread_mutex_t * aMutex , char * errmsg ) ;
void PyThreadLock() ;
Automaton()->PyLock() ;
// PyObject * Module = Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
if ( !Automaton()->PyInitModule() ) {
-// Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
- _OutNode->SuperVisionContainer()->ActivatePythonExecution( "InitPyRunMethod" , MethodPyRunMethod ) ;
+ Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_OutNode->SuperVisionContainer()->ActivatePythonExecution( "InitPyRunMethod" , MethodPyRunMethod ) ;
}
// PyObject * Dictionnary = PyModule_GetDict( Module ) ;
// InitPyDynInvokeError = PyErr_NewException( "InitPyDynInvokeError" , NULL , NULL ) ;
aPyFunc += " objref = orb.string_to_object( IORObjStr )\n" ;
aPyFunc += " return objref\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ;
-// if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
- if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
+ if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
Automaton()->PyUnLock() ;
return false ;
aPyFunc += " objIor = orb.object_to_string( ObjRef )\n" ;
aPyFunc += " return objIor\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ;
-// if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
- if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
+ if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
Automaton()->PyUnLock() ;
return false ;
try {
MESSAGE( pthread_self() << "Python method beginning : " << thePyString );
cdebug_in << pthread_self() << "Python method beginning : " << thePyString << endl ;
-// aRet = PyRun_SimpleString( thePyString );
- aRet = _OutNode->SuperVisionContainer()->ActivatePythonExecution( thePyString ) ;
+ aRet = PyRun_SimpleString( thePyString );
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //aRet = _OutNode->SuperVisionContainer()->ActivatePythonExecution( thePyString ) ;
MESSAGE( pthread_self() << "Python method finished." );
cdebug_out << pthread_self() << "Python method finished." << endl ;
} catch( ... ) {
cdebug_out << pthread_self() << "ERROR: Exception caught running Python method."
<< endl ;
MESSAGE( " Python was reinitialized. Previous Python definitions are lost" );
-// Py_Finalize();
-// Py_Initialize();
-// Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ Py_Finalize();
+ Py_Initialize();
+ Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
_OutNode->PyInitialized( false );
aRet = ErrorValue;
}
try {
MESSAGE( pthread_self() << "PyEval_CallObject method beginning : " );
cdebug << pthread_self() << "PyEval_CallObject method beginning : " << Name() << endl ;
-// Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
- Result = _OutNode->SuperVisionContainer()->ActivatePythonExecution( MyPyRunMethod , ArgsList ) ;
+ Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Result = _OutNode->SuperVisionContainer()->ActivatePythonExecution( MyPyRunMethod , ArgsList ) ;
MESSAGE( pthread_self() << "PyEval_CallObject method finished. Result " << Result );
cdebug << pthread_self() << "PyEval_CallObject method finished. Result " << Result << endl ;
cdebug_out << "Executor::InNode::PyEvalCallObject " << Name() << endl ;
MESSAGE( pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result " << Result );
cdebug << pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result "
<< Result << endl ;
-// MESSAGE( " Python was reinitialized. Previous Python definitions are lost Py_IsInitialized " << Py_IsInitialized() );
+ MESSAGE( " Python was reinitialized. Previous Python definitions are lost Py_IsInitialized " << Py_IsInitialized() );
//JR ===> fatal error in python : no current thread
-// Py_Finalize();
-// Py_Initialize();
-// Automaton()->PyInitModule( false ) ;
-// Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
-// _OutNode->PyInitialized( false );
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ Py_Finalize();
+ Py_Initialize();
+ Automaton()->PyInitModule( false ) ;
+ Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
+ _OutNode->PyInitialized( false );
+
if ( Result == NULL ) {
Kill() ; // Reset of _ThreadId
}