--- rpl/src/instructions_m4.c 2013/03/23 16:14:39 1.55 +++ rpl/src/instructions_m4.c 2013/03/24 22:06:10 1.56 @@ -142,12 +142,6 @@ instruction_mem(struct_processus *s_etat (*((integer8 *) (*((*((*((struct_liste_chainee *) (*s_objet_resultat).objet)).suivant)).donnee)).objet)) = 0; - if (pthread_mutex_lock(&mutex_liste_variables_partagees) != 0) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - nb_variables = nombre_variables(s_etat_processus); if ((tableau = malloc(((size_t) nb_variables) * @@ -155,19 +149,12 @@ instruction_mem(struct_processus *s_etat { liberation_mutexes_arbre_variables_partagees(s_etat_processus, (*(*s_etat_processus).s_arbre_variables_partagees)); - pthread_mutex_unlock(&mutex_liste_variables_partagees); (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } nb_variables = liste_variables(s_etat_processus, tableau); - if (pthread_mutex_unlock(&mutex_liste_variables_partagees) != 0) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - for(j = 0; j < nb_variables; j++) { (*((integer8 *) (*((*((*((struct_liste_chainee *) (*s_objet_resultat) @@ -909,6 +896,15 @@ instruction_mtxunlock(struct_processus * { liberation(s_etat_processus, s_objet_argument); + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + + if (pthread_mutex_unlock(&((*((struct_mutex *) + (*s_objet_argument).objet)).mutex)) != 0) + { + liberation(s_etat_processus, s_objet_argument); + (*s_etat_processus).erreur_systeme = d_es_processus; return; }