version 1.106, 2012/10/14 21:37:11
|
version 1.111, 2012/12/17 21:22:44
|
Line 91 thread_surveillance_signaux(void *argume
|
Line 91 thread_surveillance_signaux(void *argume
|
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
if (sem_wait(&(*s_queue_signaux).signalisation) == 0) |
if (sem_wait(&(*s_queue_signaux).signalisation) == 0) |
# else |
# else |
if(sem_wait(semaphore_signalisation) == 0) |
if (sem_wait(semaphore_signalisation) == 0) |
# endif |
# endif |
{ |
{ |
if ((*s_queue_signaux).requete_arret == d_vrai) |
if ((*s_queue_signaux).requete_arret == d_vrai) |
Line 173 thread_surveillance_signaux(void *argume
|
Line 173 thread_surveillance_signaux(void *argume
|
} |
} |
else |
else |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
} |
} |
} |
} |
} |
|
|
Line 332 retrait_thread(struct_processus *s_etat_
|
Line 335 retrait_thread(struct_processus *s_etat_
|
.pointeur_signal_lecture) |
.pointeur_signal_lecture) |
{ |
{ |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
sem_wait(&((*s_queue_signaux).signalisation)); |
while(sem_wait(&((*s_queue_signaux).signalisation)) != 0) |
# else |
# else |
sem_wait(semaphore_signalisation); |
while(sem_wait(semaphore_signalisation) != 0) |
# endif |
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
(*(*((struct_thread *) (*l_element_courant).donnee)).s_etat_processus) |
(*(*((struct_thread *) (*l_element_courant).donnee)).s_etat_processus) |
.pointeur_signal_lecture = ((*(*((struct_thread *) |
.pointeur_signal_lecture = ((*(*((struct_thread *) |
Line 534 liberation_threads(struct_processus *s_e
|
Line 544 liberation_threads(struct_processus *s_e
|
|
|
struct_processus *candidat; |
struct_processus *candidat; |
|
|
|
struct_liste_variables_partagees *l_element_partage_courant; |
|
struct_liste_variables_partagees *l_element_partage_suivant; |
|
|
|
struct_liste_variables_statiques *l_element_statique_courant; |
|
struct_liste_variables_statiques *l_element_statique_suivant; |
|
|
unsigned long i; |
unsigned long i; |
|
|
void *element_candidat; |
void *element_candidat; |
Line 749 liberation_threads(struct_processus *s_e
|
Line 765 liberation_threads(struct_processus *s_e
|
} |
} |
} |
} |
|
|
liberation_arbre_variables(s_etat_processus, |
// ne peut être effacé qu'une seule fois |
(*s_etat_processus).s_arbre_variables, d_faux); |
|
|
|
// Ne peut être effacé qu'une seule fois |
|
if (suppression_variables_partagees == d_faux) |
if (suppression_variables_partagees == d_faux) |
{ |
{ |
suppression_variables_partagees = d_vrai; |
suppression_variables_partagees = d_vrai; |
|
|
for(i = 0; i < (*(*s_etat_processus) |
liberation_arbre_variables_partagees(s_etat_processus, |
.s_liste_variables_partagees).nombre_variables; i++) |
(*(*s_etat_processus).s_arbre_variables_partagees)); |
{ |
|
pthread_mutex_trylock(&((*(*(*s_etat_processus) |
|
.s_liste_variables_partagees).table[i].objet) |
|
.mutex)); |
|
pthread_mutex_unlock(&((*(*(*s_etat_processus) |
|
.s_liste_variables_partagees).table[i].objet) |
|
.mutex)); |
|
|
|
liberation(s_etat_processus, (*(*s_etat_processus) |
l_element_partage_courant = (*(*s_etat_processus) |
.s_liste_variables_partagees).table[i].objet); |
.l_liste_variables_partagees); |
free((*(*s_etat_processus).s_liste_variables_partagees) |
|
.table[i].nom); |
|
} |
|
|
|
if ((*(*s_etat_processus).s_liste_variables_partagees).table |
while(l_element_partage_courant != NULL) |
!= NULL) |
|
{ |
{ |
free((struct_variable_partagee *) (*(*s_etat_processus) |
l_element_partage_suivant = |
.s_liste_variables_partagees).table); |
(*l_element_partage_courant).suivant; |
|
free(l_element_partage_courant); |
|
l_element_partage_courant = l_element_partage_suivant; |
} |
} |
|
} |
|
|
pthread_mutex_trylock(&((*(*s_etat_processus) |
liberation_arbre_variables(s_etat_processus, |
.s_liste_variables_partagees).mutex)); |
(*s_etat_processus).s_arbre_variables, d_faux); |
pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.s_liste_variables_partagees).mutex)); |
l_element_statique_courant = (*s_etat_processus) |
|
.l_liste_variables_statiques; |
|
|
|
while(l_element_statique_courant != NULL) |
|
{ |
|
l_element_statique_suivant = |
|
(*l_element_statique_courant).suivant; |
|
free(l_element_statique_courant); |
|
l_element_statique_courant = l_element_statique_suivant; |
} |
} |
|
|
element_courant = (*s_etat_processus).l_base_pile; |
element_courant = (*s_etat_processus).l_base_pile; |
Line 2501 envoi_interruptions(struct_processus *s_
|
Line 2514 envoi_interruptions(struct_processus *s_
|
default: |
default: |
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
printf("+++System : Spurious signal (%d) !\n", signal); |
printf("+++System : Signal inconnu (%d) !\n", signal); |
} |
} |
else |
else |
{ |
{ |
printf("+++System : Signal inconnu (%d) !\n", signal); |
printf("+++System : Spurious signal (%d) !\n", signal); |
} |
} |
|
|
break; |
break; |
Line 2545 scrutation_interruptions(struct_processu
|
Line 2558 scrutation_interruptions(struct_processu
|
% LONGUEUR_QUEUE_SIGNAUX; |
% LONGUEUR_QUEUE_SIGNAUX; |
|
|
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
sem_wait(&((*s_queue_signaux).signalisation)); |
while(sem_wait(&((*s_queue_signaux).signalisation)) != 0) |
# else |
# else |
sem_wait(semaphore_signalisation); |
while(sem_wait(semaphore_signalisation) != 0) |
# endif |
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
} |
} |
|
|
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
Line 2576 scrutation_interruptions(struct_processu
|
Line 2596 scrutation_interruptions(struct_processu
|
% LONGUEUR_QUEUE_SIGNAUX; |
% LONGUEUR_QUEUE_SIGNAUX; |
|
|
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) |
sem_wait(&((*s_queue_signaux).signalisation)); |
while(sem_wait(&((*s_queue_signaux).signalisation)) != 0) |
# else |
# else |
sem_wait(semaphore_signalisation); |
while(sem_wait(semaphore_signalisation) != 0) |
# endif |
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
} |
} |
|
|
pthread_mutex_unlock(&mutex_interruptions); |
pthread_mutex_unlock(&mutex_interruptions); |