--- rpl/src/instructions_f1.c 2012/12/17 21:22:43 1.47 +++ rpl/src/instructions_f1.c 2012/12/18 10:20:24 1.48 @@ -549,6 +549,12 @@ instruction_fleche(struct_processus *s_e (*s_etat_processus).objet_courant; } + if (pthread_mutex_lock(&mutex_creation_variable_partagee) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if (recherche_variable_partagee(s_etat_processus, s_variable.nom, position_variable, ((*s_etat_processus).mode_execution_programme == 'Y') @@ -556,6 +562,13 @@ instruction_fleche(struct_processus *s_e { // Variable partagée à utiliser + if (pthread_mutex_unlock(&mutex_creation_variable_partagee) + != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if (pthread_mutex_unlock(&((*(*s_etat_processus) .pointeur_variable_partagee_courante).mutex)) != 0) { @@ -580,7 +593,6 @@ instruction_fleche(struct_processus *s_e } else { - // Variable partagée à utiliser // Variable partagee à créer (*s_etat_processus).erreur_systeme = d_es; @@ -641,24 +653,17 @@ instruction_fleche(struct_processus *s_e if (creation_variable_partagee(s_etat_processus, &s_variable_partagee) == d_erreur) { - if (pthread_mutex_unlock(&((*(*s_etat_processus) - .pointeur_variable_partagee_courante).mutex)) != 0) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - return; } - if (pthread_mutex_unlock(&((*(*s_etat_processus) - .pointeur_variable_partagee_courante).mutex)) != 0) + s_variable.objet = NULL; + + if (pthread_mutex_unlock(&mutex_creation_variable_partagee) + != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } - - s_variable.objet = NULL; } } else