version 1.37, 2010/08/17 11:59:27
|
version 1.43, 2010/12/10 15:36:21
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.18 |
RPL/2 (R) version 4.0.20 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 57 decrementation_atomique(struct_objet *s_
|
Line 57 decrementation_atomique(struct_objet *s_
|
return((*s_objet).nombre_occurrences); |
return((*s_objet).nombre_occurrences); |
} |
} |
|
|
inline void |
void |
initialisation_objet(struct_objet *s_objet) |
initialisation_objet(struct_objet *s_objet) |
{ |
{ |
pthread_mutexattr_t attributs_mutex; |
pthread_mutexattr_t attributs_mutex; |
Line 758 liberation(struct_processus *s_etat_proc
|
Line 758 liberation(struct_processus *s_etat_proc
|
{ |
{ |
logical1 drapeau; |
logical1 drapeau; |
|
|
|
sigset_t oldset; |
|
sigset_t set; |
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_suivant; |
struct_liste_chainee *l_element_suivant; |
|
|
Line 1127 liberation(struct_processus *s_etat_proc
|
Line 1130 liberation(struct_processus *s_etat_proc
|
|
|
case PRC : |
case PRC : |
{ |
{ |
|
sigfillset(&set); |
|
pthread_sigmask(SIG_BLOCK, &set, &oldset); |
|
|
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex_nombre_references)) != 0) |
{ |
{ |
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
Line 1155 liberation(struct_processus *s_etat_proc
|
Line 1164 liberation(struct_processus *s_etat_proc
|
} |
} |
|
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex_nombre_references)) != 0) |
{ |
{ |
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
|
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
if (drapeau == d_vrai) |
if (drapeau == d_vrai) |
{ |
{ |
pthread_mutex_destroy(&((*(*((struct_processus_fils *) |
pthread_mutex_destroy(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)); |
(*s_objet).objet)).thread).mutex)); |
|
pthread_mutex_destroy(&((*(*((struct_processus_fils *) |
|
(*s_objet).objet)).thread).mutex_nombre_references)); |
free((*((struct_processus_fils *) (*s_objet).objet)).thread); |
free((*((struct_processus_fils *) (*s_objet).objet)).thread); |
|
|
} |
} |
|
|
if (decrementation_atomique(s_objet) > 0) |
if (decrementation_atomique(s_objet) > 0) |
Line 1497 struct_objet *
|
Line 1513 struct_objet *
|
copie_objet(struct_processus *s_etat_processus, |
copie_objet(struct_processus *s_etat_processus, |
struct_objet *s_objet, unsigned char type) |
struct_objet *s_objet, unsigned char type) |
{ |
{ |
|
sigset_t oldset; |
|
sigset_t set; |
|
|
struct_liste_chainee *l_element_base; |
struct_liste_chainee *l_element_base; |
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant_ecriture; |
struct_liste_chainee *l_element_courant_ecriture; |
Line 2267 copie_objet(struct_processus *s_etat_pro
|
Line 2286 copie_objet(struct_processus *s_etat_pro
|
|
|
case PRC : |
case PRC : |
{ |
{ |
|
sigfillset(&set); |
|
pthread_sigmask(SIG_BLOCK, &set, &oldset); |
|
|
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex_nombre_references)) != 0) |
{ |
{ |
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
return(NULL); |
return(NULL); |
} |
} |
|
|
Line 2277 copie_objet(struct_processus *s_etat_pro
|
Line 2302 copie_objet(struct_processus *s_etat_pro
|
.nombre_references++; |
.nombre_references++; |
|
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex_nombre_references)) != 0) |
{ |
{ |
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
return(NULL); |
return(NULL); |
} |
} |
|
|
|
pthread_sigmask(SIG_SETMASK, &oldset, NULL); |
|
sigpending(&set); |
|
|
if (type != 'O') |
if (type != 'O') |
{ |
{ |
incrementation_atomique(s_objet); |
incrementation_atomique(s_objet); |
Line 2295 copie_objet(struct_processus *s_etat_pro
|
Line 2326 copie_objet(struct_processus *s_etat_pro
|
|
|
(*((struct_processus_fils *) (*s_nouvel_objet).objet)) = |
(*((struct_processus_fils *) (*s_nouvel_objet).objet)) = |
(*((struct_processus_fils *) (*s_objet).objet)); |
(*((struct_processus_fils *) (*s_objet).objet)); |
|
|
break; |
break; |
} |
} |
|
|
Line 2799 copie_etat_processus(struct_processus *s
|
Line 2829 copie_etat_processus(struct_processus *s
|
# endif |
# endif |
|
|
(*s_nouvel_etat_processus).var_volatile_processus_pere = 0; |
(*s_nouvel_etat_processus).var_volatile_processus_pere = 0; |
|
(*s_nouvel_etat_processus).var_volatile_processus_racine = 0; |
(*s_nouvel_etat_processus).fichiers_graphiques = NULL; |
(*s_nouvel_etat_processus).fichiers_graphiques = NULL; |
(*s_nouvel_etat_processus).entree_standard = NULL; |
(*s_nouvel_etat_processus).entree_standard = NULL; |
(*s_nouvel_etat_processus).s_marques = NULL; |
(*s_nouvel_etat_processus).s_marques = NULL; |