version 1.50, 2013/03/21 11:30:30
|
version 1.53, 2013/03/24 22:06:10
|
Line 1034 instruction_vars(struct_processus *s_eta
|
Line 1034 instruction_vars(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
liste_variables(s_etat_processus, tableau); |
nb_variables = liste_variables(s_etat_processus, tableau); |
|
|
for(i = 0; i < nb_variables; i++) |
for(i = 0; i < nb_variables; i++) |
{ |
{ |
Line 1093 instruction_vars(struct_processus *s_eta
|
Line 1093 instruction_vars(struct_processus *s_eta
|
tableau[i].origine) == NULL) |
tableau[i].origine) == NULL) |
{ |
{ |
// La variable partagée n'existe plus. |
// La variable partagée n'existe plus. |
|
|
continue; |
continue; |
} |
} |
|
|
Line 1122 instruction_vars(struct_processus *s_eta
|
Line 1121 instruction_vars(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1145 instruction_vars(struct_processus *s_eta
|
Line 1150 instruction_vars(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1171 instruction_vars(struct_processus *s_eta
|
Line 1182 instruction_vars(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1189 instruction_vars(struct_processus *s_eta
|
Line 1206 instruction_vars(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1215 instruction_vars(struct_processus *s_eta
|
Line 1238 instruction_vars(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1236 instruction_vars(struct_processus *s_eta
|
Line 1265 instruction_vars(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1243 instruction_vars(struct_processus *s_eta
|
Line 1279 instruction_vars(struct_processus *s_eta
|
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
.pointeur_variable_partagee_courante).mutex)) != 0) |
{ |
{ |
|
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_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
Line 1256 instruction_vars(struct_processus *s_eta
|
Line 1299 instruction_vars(struct_processus *s_eta
|
.donnee = copie_objet(s_etat_processus, tableau[i].objet, |
.donnee = copie_objet(s_etat_processus, tableau[i].objet, |
'P')) == NULL) |
'P')) == 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1269 instruction_vars(struct_processus *s_eta
|
Line 1319 instruction_vars(struct_processus *s_eta
|
(*l_element_courant).donnee)).objet)).suivant).suivant) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
.suivant = allocation_maillon(s_etat_processus)) == NULL) |
.suivant = allocation_maillon(s_etat_processus)) == 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1277 instruction_vars(struct_processus *s_eta
|
Line 1333 instruction_vars(struct_processus *s_eta
|
(*l_element_courant).donnee)).objet)).suivant).suivant).suivant) |
(*l_element_courant).donnee)).objet)).suivant).suivant).suivant) |
.donnee = allocation(s_etat_processus, CHN)) == NULL) |
.donnee = allocation(s_etat_processus, CHN)) == 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1290 instruction_vars(struct_processus *s_eta
|
Line 1352 instruction_vars(struct_processus *s_eta
|
.suivant).donnee).objet = malloc(7 * |
.suivant).donnee).objet = malloc(7 * |
sizeof(unsigned char))) == NULL) |
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1315 instruction_vars(struct_processus *s_eta
|
Line 1384 instruction_vars(struct_processus *s_eta
|
(*l_element_courant).donnee)).objet)).suivant).suivant) |
(*l_element_courant).donnee)).objet)).suivant).suivant) |
.suivant).donnee).objet = malloc(9 * |
.suivant).donnee).objet = malloc(9 * |
sizeof(unsigned char))) == NULL) |
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1334 instruction_vars(struct_processus *s_eta
|
Line 1410 instruction_vars(struct_processus *s_eta
|
.suivant).suivant = allocation_maillon(s_etat_processus)) |
.suivant).suivant = allocation_maillon(s_etat_processus)) |
== NULL) |
== 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1343 instruction_vars(struct_processus *s_eta
|
Line 1425 instruction_vars(struct_processus *s_eta
|
.suivant).donnee = allocation(s_etat_processus, CHN)) |
.suivant).donnee = allocation(s_etat_processus, CHN)) |
== NULL) |
== 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1354 instruction_vars(struct_processus *s_eta
|
Line 1442 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).donnee).objet = malloc(7 * |
.suivant).suivant).donnee).objet = malloc(7 * |
sizeof(unsigned char))) == NULL) |
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1370 instruction_vars(struct_processus *s_eta
|
Line 1465 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).donnee).objet = malloc(9 * |
.suivant).suivant).donnee).objet = malloc(9 * |
sizeof(unsigned char))) == NULL) |
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1381 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 1389 instruction_vars(struct_processus *s_eta
|
Line 1491 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).suivant = |
.suivant).suivant).suivant = |
allocation_maillon(s_etat_processus)) == NULL) |
allocation_maillon(s_etat_processus)) == 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1398 instruction_vars(struct_processus *s_eta
|
Line 1506 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).donnee = allocation(s_etat_processus, |
.suivant).suivant).donnee = allocation(s_etat_processus, |
CHN)) == NULL) |
CHN)) == 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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1409 instruction_vars(struct_processus *s_eta
|
Line 1523 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).suivant).donnee).objet = malloc(7 * |
.suivant).suivant).suivant).donnee).objet = malloc(7 * |
sizeof(unsigned char))) == NULL) |
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 * |
|
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1425 instruction_vars(struct_processus *s_eta
|
Line 1569 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).suivant).donnee).objet = malloc(8 * |
.suivant).suivant).suivant).donnee).objet = malloc(8 * |
sizeof(unsigned char))) == NULL) |
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; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
} |
} |
Line 1444 instruction_vars(struct_processus *s_eta
|
Line 1595 instruction_vars(struct_processus *s_eta
|
.suivant).suivant).suivant).suivant = NULL; |
.suivant).suivant).suivant).suivant = NULL; |
|
|
l_element_precedent = l_element_courant; |
l_element_precedent = l_element_courant; |
|
|
|
if (tableau[i].mutex != NULL) |
|
{ |
|
// La variable est une variable partagée. On libère |
|
// le mutex. |
|
pthread_mutex_unlock(tableau[i].mutex); |
|
} |
} |
} |
|
|
free(tableau); |
free(tableau); |