version 1.88, 2015/01/28 22:17:39
|
version 1.95, 2015/10/22 18:37:09
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.20 |
RPL/2 (R) version 4.1.23 |
Copyright (C) 1989-2015 Dr. BERTRAND Joël |
Copyright (C) 1989-2015 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 1858 nombre_variables_locales(struct_processu
|
Line 1858 nombre_variables_locales(struct_processu
|
} |
} |
|
|
|
|
|
static void |
|
reinitialisation_recursive_mutexes_variables_partagees( |
|
struct_processus *s_etat_processus, |
|
struct_arbre_variables_partagees *l_element_courant) |
|
{ |
|
integer8 i; |
|
|
|
struct_liste_variables_partagees *l_variable; |
|
|
|
if (l_element_courant == NULL) |
|
{ |
|
return; |
|
} |
|
|
|
pthread_mutex_destroy(&((*l_element_courant).mutex_feuille)); |
|
INITIALISATION_MUTEX((*l_element_courant).mutex_feuille); |
|
|
|
if ((*l_element_courant).feuille != NULL) |
|
{ |
|
l_variable = (*l_element_courant).feuille; |
|
|
|
do |
|
{ |
|
pthread_mutex_destroy(&((*(*l_variable).variable).mutex)); |
|
INITIALISATION_MUTEX((*(*l_variable).variable).mutex); |
|
l_variable = (*l_variable).suivant; |
|
} while(l_variable != NULL); |
|
} |
|
|
|
for(i = 0; i < (*s_etat_processus).nombre_caracteres_variables; i++) |
|
{ |
|
if ((*l_element_courant).noeuds[i] != NULL) |
|
{ |
|
reinitialisation_recursive_mutexes_variables_partagees( |
|
s_etat_processus, (*l_element_courant).noeuds[i]); |
|
} |
|
} |
|
|
|
return; |
|
} |
|
|
|
|
|
void |
|
reinitialisation_mutexes_variables_partagees(struct_processus *s_etat_processus) |
|
{ |
|
reinitialisation_recursive_mutexes_variables_partagees(s_etat_processus, |
|
(*(*s_etat_processus).s_arbre_variables_partagees)); |
|
return; |
|
} |
|
|
|
|
static integer8 |
static integer8 |
nombre_variables_partagees(struct_processus *s_etat_processus, |
nombre_variables_partagees(struct_processus *s_etat_processus, |
struct_arbre_variables_partagees *l_element_courant) |
struct_arbre_variables_partagees *l_element_courant) |
Line 2236 copie_arbre_variables(struct_processus *
|
Line 2287 copie_arbre_variables(struct_processus *
|
s_variable = (*((struct_variable *) |
s_variable = (*((struct_variable *) |
(*l_element_courant).donnee)); |
(*l_element_courant).donnee)); |
|
|
if ((s_variable.nom = strdup((*((struct_variable *) |
if ((s_variable.nom = rpl_malloc(s_nouvel_etat_processus, |
(*l_element_courant).donnee)).nom)) == NULL) |
(strlen((*((struct_variable *) |
|
(*l_element_courant).donnee)).nom) + 1) * |
|
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_nouvel_etat_processus).erreur_systeme = |
(*s_nouvel_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
|
strcpy(s_variable.nom, (*((struct_variable *) |
|
(*l_element_courant).donnee)).nom); |
|
|
if ((s_variable.objet = copie_objet(s_nouvel_etat_processus, |
if ((s_variable.objet = copie_objet(s_nouvel_etat_processus, |
(*((struct_variable *) (*l_element_courant).donnee)) |
(*((struct_variable *) (*l_element_courant).donnee)) |
.objet, 'P')) == NULL) |
.objet, 'P')) == NULL) |
Line 2411 copie_arbre_variables(struct_processus *
|
Line 2467 copie_arbre_variables(struct_processus *
|
return; |
return; |
} |
} |
|
|
if ((s_variable_statique.nom = malloc((strlen( |
if ((s_variable_statique.nom = rpl_malloc(s_nouvel_etat_processus, |
(*(*l_element_statique_courant).variable).nom) + 1) * |
(strlen((*(*l_element_statique_courant).variable).nom) + 1) * |
sizeof(unsigned char))) == NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |