Stop Receive From Monitor ok
This commit is contained in:
parent
15772bb420
commit
e4f00f6816
1 changed files with 21 additions and 19 deletions
|
@ -366,12 +366,13 @@ void Tasks::ReceiveFromMonTask(void *arg) {
|
|||
Message *msgRcv;
|
||||
bool killReceiveFromMonOk=0;
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
// Synchronization barrier (waiting that all tasks are starting)
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
//while(1){
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
|
||||
|
||||
// Synchronization barrier (waiting that all tasks are starting)
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
while(1){
|
||||
//rt_sem_p(&sem_restart,TM_INFINITE);
|
||||
|
||||
//Reinitialize control boolean
|
||||
|
@ -419,16 +420,6 @@ void Tasks::ReceiveFromMonTask(void *arg) {
|
|||
rt_mutex_acquire(&mutex_acquireImage, TM_INFINITE);
|
||||
acquireImage=0;
|
||||
rt_mutex_release(&mutex_acquireImage);
|
||||
|
||||
//close Monitor
|
||||
monitor.Close();
|
||||
robot.Close();
|
||||
|
||||
sleep(2);
|
||||
|
||||
//Restart all the process
|
||||
Tasks::Join();
|
||||
//rt_sem_v(&sem_restart);
|
||||
|
||||
//exit(-1);
|
||||
|
||||
|
@ -517,12 +508,23 @@ void Tasks::ReceiveFromMonTask(void *arg) {
|
|||
delete(msgRcv); // must be deleted manually, no consumer
|
||||
|
||||
//Update loop condition
|
||||
|
||||
//cout << "J'arrive la" << endl << flush;
|
||||
|
||||
rt_mutex_acquire(&mutex_killReceiveFromMon, TM_INFINITE);
|
||||
killReceiveFromMonOk=killReceiveFromMon;
|
||||
killReceiveFromMonOk = killReceiveFromMon;
|
||||
rt_mutex_release(&mutex_killReceiveFromMon);
|
||||
|
||||
|
||||
cout << "Kill Receive From Mon Ok = " << killReceiveFromMonOk << endl << flush;
|
||||
}
|
||||
//}
|
||||
|
||||
monitor.Close();
|
||||
robot.Close();
|
||||
|
||||
cout << "ReceiveFromMon dies" << endl << flush;
|
||||
//Restart all the process
|
||||
Tasks::Join();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue