Diff for /rpl/src/gestion_variables_partagees.c between versions 1.39 and 1.71

version 1.39, 2012/12/17 21:22:43 version 1.71, 2019/10/31 15:40:06
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.11    RPL/2 (R) version 4.1.32
   Copyright (C) 1989-2012 Dr. BERTRAND Joël    Copyright (C) 1989-2019 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 84  allocation_tableau_noeuds_partages(struc Line 84  allocation_tableau_noeuds_partages(struc
     }      }
     else      else
     {      {
         objet = malloc((*s_etat_processus).nombre_caracteres_variables          objet = malloc(((size_t) (*s_etat_processus)
                   .nombre_caracteres_variables)
                 * sizeof(struct_arbre_variables_partagees *));                  * sizeof(struct_arbre_variables_partagees *));
     }      }
   
Line 285  creation_variable_partagee(struct_proces Line 286  creation_variable_partagee(struct_proces
                     .pointeurs_caracteres_variables[*ptr]])                      .pointeurs_caracteres_variables[*ptr]])
                     .indice_tableau_pere = (*s_etat_processus)                      .indice_tableau_pere = (*s_etat_processus)
                     .pointeurs_caracteres_variables[*ptr];                      .pointeurs_caracteres_variables[*ptr];
               INITIALISATION_MUTEX((*(*l_variable_courante).noeuds
                       [(*s_etat_processus).pointeurs_caracteres_variables[*ptr]])
                       .mutex_feuille);
   
             // Allocation du tableau noeuds[] et initialisation à zéro de              // Allocation du tableau noeuds[] et initialisation à zéro de
             // tous les pointeurs.              // tous les pointeurs.
Line 445  recherche_variable_partagee(struct_proce Line 449  recherche_variable_partagee(struct_proce
         {          {
             // Caractère hors de l'alphabet des variables              // Caractère hors de l'alphabet des variables
   
               pthread_mutex_unlock(&((*l_variable_courante).mutex_feuille));
             (*s_etat_processus).erreur_systeme = d_es_variable_introuvable;              (*s_etat_processus).erreur_systeme = d_es_variable_introuvable;
             return(NULL);              return(NULL);
         }          }
Line 452  recherche_variable_partagee(struct_proce Line 457  recherche_variable_partagee(struct_proce
         if ((*l_variable_courante).noeuds[pointeur] == NULL)          if ((*l_variable_courante).noeuds[pointeur] == NULL)
         {          {
             // Le chemin de la variable candidate n'existe pas.              // Le chemin de la variable candidate n'existe pas.
   
               pthread_mutex_unlock(&((*l_variable_courante).mutex_feuille));
             (*s_etat_processus).erreur_systeme = d_es_variable_introuvable;              (*s_etat_processus).erreur_systeme = d_es_variable_introuvable;
             return(NULL);              return(NULL);
         }          }
Line 459  recherche_variable_partagee(struct_proce Line 466  recherche_variable_partagee(struct_proce
         if (pthread_mutex_lock(&((*(*l_variable_courante).noeuds[pointeur])          if (pthread_mutex_lock(&((*(*l_variable_courante).noeuds[pointeur])
                 .mutex_feuille)) != 0)                  .mutex_feuille)) != 0)
         {          {
               pthread_mutex_unlock(&((*l_variable_courante).mutex_feuille));
             (*s_etat_processus).erreur_systeme = d_es_processus;              (*s_etat_processus).erreur_systeme = d_es_processus;
             return(NULL);              return(NULL);
         }          }
Line 475  recherche_variable_partagee(struct_proce Line 483  recherche_variable_partagee(struct_proce
   
     if ((*l_variable_courante).feuille != NULL)      if ((*l_variable_courante).feuille != NULL)
     {      {
         // Il existe au moins une variable statique du nom requis.          // Il existe au moins une variable partagée du nom requis.
   
         l_element_courant = (*l_variable_courante).feuille;          l_element_courant = (*l_variable_courante).feuille;
   
Line 652  retrait_variable_partagee(struct_process Line 660  retrait_variable_partagee(struct_process
         liberation(s_etat_processus, (*(*l_element_a_supprimer).variable)          liberation(s_etat_processus, (*(*l_element_a_supprimer).variable)
                 .objet);                  .objet);
         free((*(*l_element_a_supprimer).variable).nom);          free((*(*l_element_a_supprimer).variable).nom);
           pthread_mutex_unlock(&((*(*l_element_a_supprimer).variable).mutex));
           pthread_mutex_destroy(&((*(*l_element_a_supprimer).variable).mutex));
         free((*l_element_a_supprimer).variable);          free((*l_element_a_supprimer).variable);
         free(l_element_a_supprimer);          free(l_element_a_supprimer);
   

Removed from v.1.39  
changed lines
  Added in v.1.71


CVSweb interface <joel.bertrand@systella.fr>