}
void GraphExecutor::InNode::LockDataWait() {
+// cdebug_in << "GraphExecutor::InNode::LockDataWait " << endl ;
if ( pthread_mutex_lock( &_MutexDataWait ) ) {
perror("Ready pthread_mutex_lock ") ;
exit( 0 ) ;
}
_DataWait = true ;
+// cdebug_out << "GraphExecutor::InNode::LockDataWait " << endl ;
}
void GraphExecutor::InNode::UnLockDataWait() {
+// cdebug_in << "GraphExecutor::InNode::UnLockDataWait " << endl ;
_DataWait = false ;
if ( pthread_mutex_unlock( &_MutexDataWait ) ) {
perror("Ready pthread_mutex_unlock ") ;
exit( 0 ) ;
}
+// cdebug_out << "GraphExecutor::InNode::UnLockDataWait " << endl ;
}
Engines::Component_var GraphExecutor::InNode::Component() const {
return _FactoryNode->Component() ;
}
else {
- CORBA::Any const * anAnyComponent = GetChangeNodeInPort( 0 )->GetOutPort()->Value() ; // this
+//JR 30.03.2005 CORBA::Any const * anAnyComponent = GetChangeNodeInPort( 0 )->GetOutPort()->Value() ; // this
+ const CORBA::Any anAnyComponent = GetChangeNodeInPort( 0 )->GetOutPort()->Value() ; // this
CORBA::Object_ptr obj ;
try {
- *anAnyComponent >>= obj ;
+//JR 30.03.2005 *anAnyComponent >>= obj ;
+ anAnyComponent >>= obj ;
return Engines::Component::_narrow( obj ) ;
}
catch( ... ) {
}
}
}
+// PAL8003
+// JR 24.03.2005 Debug it may have be killed if we have Suspend-Resume-Kill
+ if ( !RetVal && IsKilled() ) {
+ RetVal = true ;
+ }
cdebug_out << "GraphExecutor::InNode::Kill " << Name() << " " << ThreadNo() << " "
<< Automaton()->StateName( State() ) << " Threads " << _OutNode->Threads()
<< " SuspendedThreads " << _OutNode->SuspendedThreads()
- << " EventQSize " << _OutNode->EventQSize() << endl ;
+ << " EventQSize " << _OutNode->EventQSize() << " returns " << RetVal << endl ;
return RetVal ;
}
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
if ( GetNodeOutPort(i)->IsDataStream() ) {
- GetChangeNodeOutPort(i)->State( SUPERV::ReadyState ) ;
- GetChangeNodeOutPort(i)->Done( true ) ;
+ GetChangeNodeOutPort(i)->PortState( SUPERV::ReadyState ) ;
+ GetChangeNodeOutPort(i)->PortDone( true ) ;
}
else if ( i != 0 || !IsGOTONode() ) {
- GetChangeNodeOutPort(i)->State( SUPERV::WaitingState ) ;
- GetChangeNodeOutPort(i)->Done( false ) ;
+ GetChangeNodeOutPort(i)->PortState( SUPERV::WaitingState ) ;
+ GetChangeNodeOutPort(i)->PortDone( false ) ;
}
}
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
if ( IsHeadNode() && IsLoopNode() && anInPort->IsLoop() ) {
anOutPort->PortStatus( DataConnected );
- anOutPort->State( SUPERV::ReadyState ) ;
- anOutPort->Done( true ) ;
- CORBA::Any * anAny = new CORBA::Any() ;
- *anAny <<= (long ) 1 ;
+ anOutPort->PortState( SUPERV::ReadyState ) ;
+ anOutPort->PortDone( true ) ;
+//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ;
+ CORBA::Any anAny = CORBA::Any() ;
+//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 1 ;
+ anAny <<= (long ) 1 ;
anOutPort->Value( anAny ) ;
_InitLoop = true ;
+ cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
+ << " OutPort " << anOutPort->PortStatus() << theAutomaton->StateName( anOutPort->PortState() )
+ << " InitLoop HeadNode" << endl ;
}
// JR 15_09_2004 if backward link from GOTONode or EndLoopNode ==> DataConnected
else if ( anInPort->IsGate() && anOutPort ) {
- anOutPort->State( SUPERV::WaitingState ) ;
- anOutPort->Done( false ) ;
+ anOutPort->PortState( SUPERV::WaitingState ) ;
+ anOutPort->PortDone( false ) ;
const GraphBase::ComputingNode * aFromNode = _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() ) ;
//JR if ( aFromNode->IsGOTONode() || aFromNode->IsEndLoopNode() ) {
if ( aFromNode->IsGOTONode() || ( IsLoopNode() && CoupledNode() == aFromNode ) ) {
// before was "else if ( IsOneOfInlineNodes() )"
// IsOneOfInline() == ( Inline || IsOneOfGOTO() ), so Inline are removed..
anOutPort->PortStatus( DataConnected );
- anOutPort->State( SUPERV::ReadyState ) ;
- anOutPort->Done( true ) ;
+ anOutPort->PortState( SUPERV::ReadyState ) ;
+ anOutPort->PortDone( true ) ;
}
+ cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
+ << " OutPort " << anOutPort->PortStatus() << theAutomaton->StateName( anOutPort->PortState() )
+ << " Gate HeadNode" << endl ;
+ }
+ else {
+ cdebug << Name() << " IsHeadNode " << IsHeadNode() << " InPort" << i << " " << anInPort->PortName()
+ << " " << anInPort->PortStatus() << endl ;
}
if ( anInPort->IsGate() && anOutPort == NULL ) {
Pc-- ;
else if ( anOutPort ) {
if ( anOutPort->IsDataConnected() || anOutPort->IsDataStream() ) {
Pc-- ;
- anOutPort->State( SUPERV::ReadyState ) ;
- anOutPort->Done( true ) ;
+ anOutPort->PortState( SUPERV::ReadyState ) ;
+ anOutPort->PortDone( true ) ;
cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
- << " " << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ;
+ << " " << theAutomaton->StateName( anOutPort->PortState() ) << " Pc " << Pc << endl ;
}
else if ( anOutPort->IsPortConnected() ) {
- anOutPort->State( SUPERV::WaitingState ) ;
- anOutPort->Done( false ) ;
+ anOutPort->PortState( SUPERV::WaitingState ) ;
+ anOutPort->PortDone( false ) ;
cdebug << "InPort" << i << " " << anInPort->PortName() << " " << " " << anInPort->PortStatus()
- << " " << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ;
+ << " " << theAutomaton->StateName( anOutPort->PortState() ) << " Pc " << Pc << endl ;
}
else {
cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
<< " OutPort " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
- << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ;
+ << theAutomaton->StateName( anOutPort->PortState() ) << " Pc " << Pc << endl ;
}
}
else {
if ( !anOutPort->IsDataStream() || anInPort->IsDataStream() ) {
cdebug << "InPort" << i << " state change : " << anInPort->PortName() << " from OutPort "
<< anOutPort->PortName() << " from Node " << anOutPort->NodeName()
- << " with state " << theAutomaton->StateName( anOutPort->State() ) << endl ;
- GetChangeNodeInPort(i)->State( anOutPort->State() ) ;
+ << " with state of OutPort : " << theAutomaton->StateName( anOutPort->PortState() ) << endl ;
+ GetChangeNodeInPort(i)->PortState( anOutPort->PortState() ) ;
}
else if ( anOutPort->IsDataConnected() ) {
cdebug << "InPort" << i << " state change : " << anInPort->PortName() << " from OutPort "
<< anOutPort->PortName() << " from Node " << anOutPort->NodeName()
<< " with state ReadyState" << endl ;
- GetChangeNodeInPort(i)->State( SUPERV::ReadyState ) ;
+ GetChangeNodeInPort(i)->PortState( SUPERV::ReadyState ) ;
}
else {
cdebug << "InPort" << i << " state NOT changed : " << anInPort->PortName() << " from OutPort "
<< anOutPort->PortName() << " " << anOutPort->PortStatus() << " from Node " << anOutPort->NodeName()
- << " with state " << anOutPort->State() << endl ;
+ << " with state " << theAutomaton->StateName( anOutPort->PortState() ) << endl ;
}
}
if ( anOutPort ) {
cdebug << "InPort" << i << " : " << anInPort->PortName() << " from OutPort "
<< anOutPort->PortName() << " from Node " << anOutPort->NodeName()
<< " with state " ;
- if ( anOutPort->State() == SUPERV::WaitingState ) {
+ if ( anOutPort->PortState() == SUPERV::WaitingState ) {
cdebug << "WaitingState" ;
}
- else if ( anOutPort->State() == SUPERV::ReadyState ) {
+ else if ( anOutPort->PortState() == SUPERV::ReadyState ) {
cdebug << "ReadyState" ;
}
else {
cdebug << "???" ;
}
- cdebug << " PortConnected("
- << anOutPort->IsPortConnected() << ") DataConnected("
- << anOutPort->IsDataConnected() << ")" << endl ;
+ cdebug << " OutPortStatus " << anOutPort->PortStatus() << " State "
+ << theAutomaton->StateName( anOutPort->PortState() ) << endl ;
}
}
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
cdebug << "OutPort" << i << " : " << GetNodeOutPort(i)->PortName() << " "
- << theAutomaton->StateName( GetChangeNodeOutPort(i)->State() )
+ << theAutomaton->StateName( GetChangeNodeOutPort(i)->PortState() )
<< " " << GetNodeOutPort(i)->Kind() << endl ;
}
CORBA::Long cpu = 0 ;
// cout << "Begin CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
// << theAutomaton->StateName( _currentState ) << endl ;
- cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
+// cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
if ( IsOneOfInLineNodes() ) {
// cdebug << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
// cout << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
}
}
}
- cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
+// cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
// cout << "End CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
// << theAutomaton->StateName( _currentState ) << endl ;
return cpu ;