exit( 0 ) ;
}
if ( !_ThreadStartedSync ) {
- cdebug << "pthread_cond " << Name() << " ThreadStarted pthread_cond_wait"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStarted pthread_cond_wait"
<< endl ;
_ThreadStartedSync = true ;
if ( pthread_cond_wait( &_ThreadStartedWait , &_MutexWait ) ) {
perror("ThreadStarted pthread_cond_wait ") ;
}
- cdebug << "pthread_cond " << Name() << " ThreadStarted pthread_cond_waited"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStarted pthread_cond_waited"
<< endl ;
}
else {
- cdebug << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_wait"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_wait"
<< endl ;
//Debug :
_ThreadStartedSync = false ;
perror("ThreadStart pthread_cond_signal ") ;
}
//Debug
- cdebug << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_signaled"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_signaled"
<< endl ;
}
if ( pthread_mutex_unlock( &_MutexWait ) ) {
exit( 0 ) ;
}
if ( _ThreadStartedSync ) {
- cdebug << "pthread_cond " << Name() << " ThreadStart pthread_cond_signal"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStart pthread_cond_signal"
<< endl ;
_ThreadStartedSync = false ;
if ( pthread_cond_signal( &_ThreadStartedWait ) ) {
perror("ThreadStart pthread_cond_broadcast ") ;
}
- cdebug << "pthread_cond " << Name() << " ThreadStart pthread_cond_signaled"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStart pthread_cond_signaled"
<< endl ;
}
else {
- cdebug << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_signal"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_signal"
<< endl ;
_ThreadStartedSync = true ;
//Debug :
perror("ThreadStarted pthread_cond_wait ") ;
}
//Debug
- cdebug << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_waited"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_waited"
<< endl ;
}
if ( pthread_mutex_unlock( &_MutexWait ) ) {
}
void GraphExecutor::InNode::coutbegin() {
- cdebug << ThreadNo() << " " << pthread_self() << " run_function begin"
+ cdebug << pthread_self() << "/" << ThreadNo() << " run_function begin"
<< " " << Name() << " " << Automaton()->StateName( State() ) << endl ;
}
void GraphExecutor::InNode::coutexit() {
int GraphExecutor::InNode::ExecuteAction() {
int sts ;
-// const char * nextactionname = Automaton()->ActionName( _NextAction ) ;
-// const char * statename = Automaton()->StateName( State() ) ;
-// const char * nextstatename = Automaton()->StateName( _NextState ) ;
-// cdebug << pthread_self() << "/" << ThreadNo() << " --> ExecuteAction "
-// << nextactionname << " " << statename << " NextState "
-// << nextstatename << endl ;
+ const char * nextactionname = Automaton()->ActionName( _NextAction ) ;
+ const char * statename = Automaton()->StateName( State() ) ;
+ const char * nextstatename = Automaton()->StateName( _NextState ) ;
+ cdebug_in << pthread_self() << "/" << ThreadNo() << " --> ExecuteAction "
+ << nextactionname << " " << statename << " NextState "
+ << nextstatename << endl ;
State( _NextState ) ;
switch ( _NextAction ) {
return 0 ;
}
}
-// cdebug << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction "
-// << Automaton()->ActionName( nextaction ) << endl ;
+ cdebug_out << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction "
+ << nextactionname << endl ;
return sts ;
}
State( GraphExecutor::DataWaitingState ) ;
for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
GraphBase::InPort * anInPort = GetChangeNodeInPort( i ) ;
- if ( anInPort->IsGate() ) { // Loop : Open the doors
+ cdebug << "SetWaitingStates InPort " << Name() << "( " << anInPort->PortName() << " ) "
+ << anInPort->PortStatus() << " " << anInPort->State() << endl ;
+// JR Debug 07.01.2005 : Close the Gates instead of open !!!
+ if ( anInPort->IsGate() ) { // Loop : Close the doors
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
if ( anOutPort ) {
CORBA::Any * anAny = new CORBA::Any() ;
- *anAny <<= (long ) 1 ;
+// *anAny <<= (long ) 1 ;
+ *anAny <<= (long ) 0 ;
anOutPort->Value( anAny ) ;
- anInPort->State( SUPERV::ReadyState ) ;
+ anInPort->State( SUPERV::WaitingState ) ;
}
}
- else if ( anInPort->State() != SUPERV::WaitingState ) {
+ else if ( anInPort->State() != SUPERV::WaitingState &&
+ !anInPort->IsDataConnected() ) {
if ( !docdebug ) {
cdebug << ThreadNo()
<< " --> GraphExecutor::InNodeThreads::SetWaitingStates " << Name() << endl;
anInPort->State( SUPERV::WaitingState ) ;
}
}
+ cdebug << " --> " << Name() << "( " << anInPort->PortName() << " ) "
+ << anInPort->PortStatus() << " " << anInPort->State() << endl ;
}
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
if ( !( IsGOTONode() && anOutPort->IsGate() ) &&
- !( IsEndLoopNode() && ( anOutPort->IsGate() ||
- anOutPort->IsLoop() ) ) &&
+ !( IsEndLoopNode() && ( anOutPort->IsGate() || anOutPort->IsLoop() ) ) &&
!anOutPort->IsDataStream() &&
!anOutPort->ChangeInPorts( j )->IsDataStream() &&
!anOutPort->ChangeInPorts( j )->IsExternConnected() ) {
cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode "
<< aLabelNode->Name() << " from port " << anInPort->PortName() << endl ;
aLabelNode->SetWaitingStates( this ) ;
+// JR 07.01.2005 Debug : Open the Gate of the coupledNode closed by SetWaitingStates
+ GraphBase::OutPort * anOutPort = aLabelNode->GetChangeNodeInGate()->GetOutPort() ;
+ if ( anOutPort ) {
+ CORBA::Any * anAny = new CORBA::Any() ;
+ *anAny <<= (long ) 1 ;
+ anOutPort->Value( anAny ) ;
+ aLabelNode->GetChangeNodeInGate()->State( SUPERV::ReadyState ) ;
+ }
for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) {
const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ;
if ( anInPort->GetOutPort() ) {
*anAny <<= (long ) 0 ;
theOutPort->Value( anAny ) ;
}
- if ( !anInPort->IsDataStream() ) {
+ if ( !anInPort->IsDataStream() &&
+ !anInPort->IsDataConnected() ) {
anInPort->State( SUPERV::WaitingState ) ;
}
D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ;