diff --git a/software/raspberry/superviseur-robot/tasks.cpp b/software/raspberry/superviseur-robot/tasks.cpp index 30bbf1d..68af1b8 100644 --- a/software/raspberry/superviseur-robot/tasks.cpp +++ b/software/raspberry/superviseur-robot/tasks.cpp @@ -423,8 +423,14 @@ void Tasks::ReceiveFromMonTask(void *arg) { sleep(1); //All closes - monitor.Close(); - robot.Close(); + rt_mutex_acquire(&mutex_monitor, TM_INFINITE); + monitor.Close(); + rt_mutex_release(&mutex_monitor); + + + rt_mutex_acquire(&mutex_robot, TM_INFINITE); + robot.Close(); + rt_mutex_release(&mutex_robot); //Tasks::Join();