Skip to content
Snippets Groups Projects
Commit 79964329 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

When the communication thread catches an exception, it sets the communication...

When the communication thread catches an exception, it sets the communication object to the created state before finishing the thread.
parent 4d49084b
No related branches found
No related tags found
1 merge request!1Used the pthread_setcancelstate function to configure where the thread can be cancelled.
......@@ -261,6 +261,15 @@ void *CComm::comm_thread(void *param)
}
comm_dev->access_comm.exit();
}catch(CException &e){
try{
comm_dev->hard_close();
}catch(CException &close){
std::cout << close.what() << std::endl;
}
/* flush the data queues */
comm_dev->receive_queue.flush();
/* change the current state */
comm_dev->state=created;
comm_dev->access_comm.exit();
std::cout << e.what() << std::endl;
end=true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment