--- rpl/src/instructions_d5.c 2015/07/21 12:30:38 1.131 +++ rpl/src/instructions_d5.c 2015/07/21 20:16:19 1.132 @@ -1094,6 +1094,12 @@ instruction_detach(struct_processus *s_e return; } + if (pthread_mutex_lock(&mutex_liste_variables_partagees) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + fflush(NULL); /* @@ -1132,6 +1138,12 @@ instruction_detach(struct_processus *s_e * Processus père */ + if (pthread_mutex_unlock(&mutex_liste_variables_partagees) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if (variable_partagee == d_vrai) { liberation(s_etat_processus, s_copie); @@ -1269,6 +1281,13 @@ instruction_detach(struct_processus *s_e * Processus fils */ + pthread_mutex_destroy(&mutex_liste_variables_partagees); + + pthread_mutexattr_init(&attributs_mutex); + pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&mutex_liste_variables_partagees, &attributs_mutex); + pthread_mutexattr_destroy(&attributs_mutex); + liberation_queue_signaux(s_etat_processus); creation_queue_signaux(s_etat_processus);