Stop Receive From Monitor ok

This commit is contained in:
Raphael Benistant 2020-03-29 10:25:23 +02:00
parent 15772bb420
commit e4f00f6816

View file

@ -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);
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
//while(1){
// 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
@ -420,16 +421,6 @@ void Tasks::ReceiveFromMonTask(void *arg) {
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();
}
}
/**