version 1.51, 2013/03/23 16:14:39
|
version 1.53, 2013/03/24 22:06:10
|
Line 1023 instruction_vars(struct_processus *s_eta
|
Line 1023 instruction_vars(struct_processus *s_eta
|
(*s_objet_resultat).objet = NULL; |
(*s_objet_resultat).objet = NULL; |
l_element_precedent = NULL; |
l_element_precedent = NULL; |
|
|
if (pthread_mutex_lock(&mutex_liste_variables_partagees) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
nb_variables = nombre_variables(s_etat_processus); |
nb_variables = nombre_variables(s_etat_processus); |
|
|
if ((tableau = malloc(((size_t) nb_variables) * |
if ((tableau = malloc(((size_t) nb_variables) * |
Line 1036 instruction_vars(struct_processus *s_eta
|
Line 1030 instruction_vars(struct_processus *s_eta
|
{ |
{ |
liberation_mutexes_arbre_variables_partagees(s_etat_processus, |
liberation_mutexes_arbre_variables_partagees(s_etat_processus, |
(*(*s_etat_processus).s_arbre_variables_partagees)); |
(*(*s_etat_processus).s_arbre_variables_partagees)); |
pthread_mutex_unlock(&mutex_liste_variables_partagees); |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
nb_variables = liste_variables(s_etat_processus, tableau); |
nb_variables = liste_variables(s_etat_processus, tableau); |
|
|
if (pthread_mutex_unlock(&mutex_liste_variables_partagees) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
for(i = 0; i < nb_variables; i++) |
for(i = 0; i < nb_variables; i++) |
{ |
{ |
if (l_element_precedent == NULL) |
if (l_element_precedent == NULL) |
Line 1496 instruction_vars(struct_processus *s_eta
|
Line 1483 instruction_vars(struct_processus *s_eta
|
} |
} |
|
|
/* |
/* |
* Préparation du drapeau PRIVATE/SHARED |
* Préparation du drapeau PRIVATE/SHARED/MAPPED |
*/ |
*/ |
|
|
if (((*(*(*(*(*((struct_liste_chainee *) (*((struct_objet *) |
if (((*(*(*(*(*((struct_liste_chainee *) (*((struct_objet *) |
Line 1533 instruction_vars(struct_processus *s_eta
|
Line 1520 instruction_vars(struct_processus *s_eta
|
{ |
{ |
if (((*(*(*(*(*(*(*((struct_liste_chainee *) (*((struct_objet *) |
if (((*(*(*(*(*(*(*((struct_liste_chainee *) (*((struct_objet *) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
|
.suivant).suivant).suivant).donnee).objet = malloc(7 * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
if (tableau[i].mutex != NULL) |
|
{ |
|
// La variable est une variable partagée. On libère |
|
// le mutex. |
|
pthread_mutex_unlock(tableau[i].mutex); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) (*(*(*(*(*(*(*((struct_liste_chainee *) |
|
(*((struct_objet *) (*l_element_courant).donnee)).objet)) |
|
.suivant).suivant).suivant).suivant).suivant).donnee).objet, |
|
"MAPPED"); |
|
} |
|
else if (tableau[i].mutex != NULL) |
|
{ |
|
if (((*(*(*(*(*(*(*((struct_liste_chainee *) (*((struct_objet *) |
|
(*l_element_courant).donnee)).objet)).suivant).suivant) |
.suivant).suivant).suivant).donnee).objet = malloc(7 * |
.suivant).suivant).suivant).donnee).objet = malloc(7 * |
sizeof(unsigned char))) == NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |