--- rpl/src/gestion_objets.c 2011/09/26 15:57:10 1.73 +++ rpl/src/gestion_objets.c 2011/11/26 10:01:26 1.75 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 + RPL/2 (R) version 4.1.5 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. @@ -2216,19 +2216,8 @@ copie_objet(struct_processus *s_etat_pro case MTX : { - if (type != 'O') - { - incrementation_atomique(s_objet); - return(s_objet); - } - - if ((s_nouvel_objet = allocation(s_etat_processus, MTX)) == NULL) - { - return(NULL); - } - - (*((struct_mutex *) ((*s_nouvel_objet).objet))).mutex = - (*((struct_mutex *) ((*s_objet).objet))).mutex; + // La duplication d'un mutex renvoie le même objet. + incrementation_atomique(s_objet); break; } @@ -2484,6 +2473,8 @@ copie_objet(struct_processus *s_etat_pro return(NULL); } + (*((struct_semaphore *) (*s_nouvel_objet).objet)).semaphore = + (*((struct_semaphore *) (*s_objet).objet)).semaphore; strcpy((*((struct_semaphore *) (*s_nouvel_objet).objet)).nom, (*((struct_semaphore *) (*s_objet).objet)).nom); break;