version 1.125, 2015/11/26 11:44:31
|
version 1.135, 2017/07/12 15:42:42
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.24 |
RPL/2 (R) version 4.1.27 |
Copyright (C) 1989-2015 Dr. BERTRAND Joël |
Copyright (C) 1989-2017 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 343 allocation(struct_processus *s_etat_proc
|
Line 343 allocation(struct_processus *s_etat_proc
|
} |
} |
|
|
(*s_objet).type = type; |
(*s_objet).type = type; |
|
(*s_objet).extension_type = 0; |
|
(*s_objet).descripteur_bibliotheque = NULL; |
|
|
switch(type) |
switch(type) |
{ |
{ |
Line 434 allocation(struct_processus *s_etat_proc
|
Line 436 allocation(struct_processus *s_etat_proc
|
break; |
break; |
} |
} |
|
|
|
case EXT : |
|
{ |
|
// Aucune allocation |
|
break; |
|
} |
|
|
case FCT : |
case FCT : |
{ |
{ |
if ((*s_etat_processus).pointeur_fct > 0) |
if ((*s_etat_processus).pointeur_fct > 0) |
Line 821 liberation(struct_processus *s_etat_proc
|
Line 829 liberation(struct_processus *s_etat_proc
|
struct_liste_chainee *l_element_suivant; |
struct_liste_chainee *l_element_suivant; |
|
|
integer8 i; |
integer8 i; |
|
integer8 (*__type_drop)(struct_processus *, |
|
void **); |
|
|
if (s_objet == NULL) |
if (s_objet == NULL) |
{ |
{ |
Line 1493 liberation(struct_processus *s_etat_proc
|
Line 1503 liberation(struct_processus *s_etat_proc
|
break; |
break; |
} |
} |
|
|
|
case EXT: |
|
{ |
|
if (decrementation_atomique(s_objet) > 0) |
|
{ |
|
return; |
|
} |
|
|
|
// Appel de la fonction de liberation associée à l'objet |
|
// externe. Le descripteur de bibliothèque est directement |
|
// associé à la structure objet. |
|
|
|
l_element_courant = (*s_etat_processus).s_bibliotheques; |
|
|
|
while(l_element_courant != NULL) |
|
{ |
|
if ((*((struct_bibliotheque *) (*l_element_courant).donnee)) |
|
.descripteur == (*s_objet).descripteur_bibliotheque) |
|
{ |
|
if ((__type_drop = dlsym((*s_objet) |
|
.descripteur_bibliotheque, "__type_drop")) == NULL) |
|
{ |
|
// La fonction de libération n'existe pas dans la |
|
// bibliothèque. |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_type_externe_drop; |
|
} |
|
else |
|
{ |
|
if (__type_drop(s_etat_processus, (void **) &s_objet) |
|
== 0) |
|
{ |
|
(*s_etat_processus).erreur_execution = |
|
d_ex_type_externe_drop; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
l_element_courant = (*l_element_courant).suivant; |
|
} |
|
|
|
if (l_element_courant == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_type_externe_drop; |
|
} |
|
|
|
break; |
|
} |
|
|
default : |
default : |
{ |
{ |
if (pthread_mutex_unlock(&((*s_objet).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_objet).mutex)) != 0) |
Line 1591 copie_objet(struct_processus *s_etat_pro
|
Line 1652 copie_objet(struct_processus *s_etat_pro
|
|
|
integer8 i; |
integer8 i; |
integer8 j; |
integer8 j; |
|
integer8 (*__type_dup)(struct_processus *, void **); |
|
|
if (pthread_mutex_lock(&((*s_objet).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_objet).mutex)) != 0) |
{ |
{ |
Line 2810 copie_objet(struct_processus *s_etat_pro
|
Line 2872 copie_objet(struct_processus *s_etat_pro
|
} |
} |
|
|
break; |
break; |
|
} |
|
|
|
case EXT: |
|
{ |
|
if (type != 'O') |
|
{ |
|
incrementation_atomique(s_objet); |
|
return(s_objet); |
|
} |
|
|
|
// Appel de la fonction de duplication associée à l'objet |
|
// externe. Le descripteur de bibliothèque est directement |
|
// associé à la structure objet. |
|
|
|
l_element_courant = (*s_etat_processus).s_bibliotheques; |
|
|
|
while(l_element_courant != NULL) |
|
{ |
|
if ((*((struct_bibliotheque *) (*l_element_courant).donnee)) |
|
.descripteur == (*s_objet).descripteur_bibliotheque) |
|
{ |
|
if ((__type_dup = dlsym((*s_objet).descripteur_bibliotheque, |
|
"__type_dup")) == NULL) |
|
{ |
|
// La fonction de duplication n'existe pas dans la |
|
// bibliothèque. |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_type_externe_dup; |
|
return(NULL); |
|
} |
|
|
|
s_nouvel_objet = s_objet; |
|
|
|
if (__type_dup(s_etat_processus, (void **) &s_nouvel_objet) |
|
== 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
break; |
|
} |
|
|
|
l_element_courant = (*l_element_courant).suivant; |
|
} |
|
|
|
if (l_element_courant == NULL) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_type_externe_dup; |
|
return(NULL); |
|
} |
|
|
|
break; |
} |
} |
|
|
default : |
default : |