Diff for /rpl/src/instructions_m4.c between versions 1.36 and 1.37

version 1.36, 2011/11/26 10:01:29 version 1.37, 2011/11/26 13:05:03
Line 453  instruction_mtxlock(struct_processus *s_ Line 453  instruction_mtxlock(struct_processus *s_
             return;              return;
         }          }
   
           (*((struct_mutex *) (*s_objet_argument).objet)).tid = pthread_self();
   
 #       ifndef SEMAPHORES_NOMMES  #       ifndef SEMAPHORES_NOMMES
             while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0)              while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0)
 #       else  #       else
Line 609  instruction_mtxtrylock(struct_processus Line 611  instruction_mtxtrylock(struct_processus
             }              }
         }          }
   
           (*((struct_mutex *) (*s_objet_argument).objet)).tid = pthread_self();
   
         if ((*s_etat_processus).profilage == d_vrai)          if ((*s_etat_processus).profilage == d_vrai)
         {          {
             profilage(s_etat_processus, NULL);              profilage(s_etat_processus, NULL);
Line 642  instruction_mtxtrylock(struct_processus Line 646  instruction_mtxtrylock(struct_processus
     return;      return;
 }  }
   
   
 /*  /*
 ================================================================================  ================================================================================
   Fonction 'mtxstatus'    Fonction 'mtxstatus'
Line 766  instruction_mtxstatus(struct_processus * Line 771  instruction_mtxstatus(struct_processus *
             }              }
         }          }
   
         if (pthread_mutex_unlock(&((*((struct_mutex *)          if (ios == 0)
                 (*s_objet_argument).objet)).mutex)) != 0)  
         {          {
             liberation(s_etat_processus, s_objet_argument);              // Le mutex a été verrouillé par le trylock précédent.
   
             if ((*s_etat_processus).profilage == d_vrai)              if (pthread_mutex_unlock(&((*((struct_mutex *)
                       (*s_objet_argument).objet)).mutex)) != 0)
             {              {
                 profilage(s_etat_processus, NULL);                  liberation(s_etat_processus, s_objet_argument);
             }  
   
             (*s_etat_processus).erreur_systeme = d_es_processus;                  if ((*s_etat_processus).profilage == d_vrai)
             return;                  {
                       profilage(s_etat_processus, NULL);
                   }
   
                   (*s_etat_processus).erreur_systeme = d_es_processus;
                   return;
               }
         }          }
   
         if ((*s_etat_processus).profilage == d_vrai)          if ((*s_etat_processus).profilage == d_vrai)
Line 891  instruction_mtxunlock(struct_processus * Line 901  instruction_mtxunlock(struct_processus *
   
         if (l_element_courant == NULL)          if (l_element_courant == NULL)
         {          {
               liberation(s_etat_processus, s_objet_argument);
   
             (*s_etat_processus).erreur_execution = d_ex_mutex;              (*s_etat_processus).erreur_execution = d_ex_mutex;
               return;
           }
   
           if (pthread_equal(pthread_self(), (*((struct_mutex *)
                   (*s_objet_argument).objet)).tid) == 0)
           {
             liberation(s_etat_processus, s_objet_argument);              liberation(s_etat_processus, s_objet_argument);
   
               (*s_etat_processus).erreur_execution =
                       d_ex_mutex_acquis_autre_thread;
             return;              return;
         }          }
   

Removed from v.1.36  
changed lines
  Added in v.1.37


CVSweb interface <joel.bertrand@systella.fr>