version 1.21, 2010/04/28 07:05:38
|
version 1.26, 2010/05/24 10:58:37
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.15 |
RPL/2 (R) version 4.0.16 |
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 447 rplinit(int argc, char *argv[], unsigned
|
Line 447 rplinit(int argc, char *argv[], unsigned
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
|
|
action.sa_sigaction = interruption11; |
|
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
|
|
|
if (sigaction(SIGFABORT, &action, NULL) != 0) |
|
{ |
|
erreur = d_es_signal; |
|
|
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
printf("+++Système : Initialisation des signaux POSIX " |
|
"impossible\n"); |
|
} |
|
else |
|
{ |
|
printf("+++System : Initialization of POSIX signals failed\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
action.sa_sigaction = interruption8; |
action.sa_sigaction = interruption8; |
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
action.sa_flags = SA_NODEFER | SA_ONSTACK | SA_SIGINFO; |
|
|
Line 1857 rplinit(int argc, char *argv[], unsigned
|
Line 1877 rplinit(int argc, char *argv[], unsigned
|
(*s_etat_processus).var_volatile_traitement_sigint = 0; |
(*s_etat_processus).var_volatile_traitement_sigint = 0; |
(*s_etat_processus).var_volatile_recursivite = 0; |
(*s_etat_processus).var_volatile_recursivite = 0; |
(*s_etat_processus).var_volatile_exception_gsl = 0; |
(*s_etat_processus).var_volatile_exception_gsl = 0; |
|
(*s_etat_processus).arret_depuis_abort = 0; |
|
|
initialisation_allocateur(s_etat_processus); |
initialisation_allocateur(s_etat_processus); |
initialisation_drapeaux(s_etat_processus); |
initialisation_drapeaux(s_etat_processus); |
Line 2623 rplinit(int argc, char *argv[], unsigned
|
Line 2644 rplinit(int argc, char *argv[], unsigned
|
|
|
if (erreur == d_absence_erreur) |
if (erreur == d_absence_erreur) |
{ |
{ |
if ((*s_etat_processus).at_exit != NULL) |
if (((*s_etat_processus).var_volatile_alarme == 0) |
|
&& ((*s_etat_processus).arret_depuis_abort |
|
== 0) && ((*s_etat_processus).at_exit |
|
!= NULL)) |
{ |
{ |
erreur = evaluation(s_etat_processus, |
erreur = evaluation(s_etat_processus, |
(*s_etat_processus).at_exit, 'E'); |
(*s_etat_processus).at_exit, 'E'); |
Line 2750 rplinit(int argc, char *argv[], unsigned
|
Line 2774 rplinit(int argc, char *argv[], unsigned
|
} |
} |
else |
else |
{ |
{ |
kill((*(*((struct_processus_fils *) |
if ((*s_etat_processus).arret_depuis_abort |
(*(*((struct_liste_chainee *) |
== -1) |
l_element_courant)).donnee).objet)) |
{ |
.thread).pid, SIGFSTOP); |
kill((*(*((struct_processus_fils *) |
|
(*(*((struct_liste_chainee *) |
|
l_element_courant)).donnee).objet)) |
|
.thread).pid, SIGFABORT); |
|
} |
|
else |
|
{ |
|
kill((*(*((struct_processus_fils *) |
|
(*(*((struct_liste_chainee *) |
|
l_element_courant)).donnee).objet)) |
|
.thread).pid, SIGFSTOP); |
|
} |
} |
} |
} |
} |
else |
else |
Line 2778 rplinit(int argc, char *argv[], unsigned
|
Line 2813 rplinit(int argc, char *argv[], unsigned
|
} |
} |
else |
else |
{ |
{ |
pthread_kill((*(*((struct_processus_fils *) |
if ((*s_etat_processus).arret_depuis_abort |
(*(*((struct_liste_chainee *) |
== -1) |
l_element_courant)).donnee).objet)) |
{ |
.thread).tid, SIGFSTOP); |
pthread_kill( |
|
(*(*((struct_processus_fils *) |
|
(*(*((struct_liste_chainee *) |
|
l_element_courant)).donnee) |
|
.objet)).thread).tid, |
|
SIGFABORT); |
|
} |
|
else |
|
{ |
|
pthread_kill( |
|
(*(*((struct_processus_fils *) |
|
(*(*((struct_liste_chainee *) |
|
l_element_courant)).donnee) |
|
.objet)).thread).tid, |
|
SIGFSTOP); |
|
} |
} |
} |
} |
} |
|
|
Line 2814 rplinit(int argc, char *argv[], unsigned
|
Line 2864 rplinit(int argc, char *argv[], unsigned
|
l_element_courant = (void *) |
l_element_courant = (void *) |
(*s_etat_processus).l_base_pile_processus; |
(*s_etat_processus).l_base_pile_processus; |
|
|
if ((*s_etat_processus) |
|
.nombre_interruptions_non_affectees != 0) |
|
{ |
|
affectation_interruptions_logicielles( |
|
s_etat_processus); |
|
} |
|
|
|
for(i = 0; i < (unsigned long) |
for(i = 0; i < (unsigned long) |
(*(*((struct_processus_fils *) |
(*(*((struct_processus_fils *) |
(*(*((struct_liste_chainee *) |
(*(*((struct_liste_chainee *) |
Line 2879 rplinit(int argc, char *argv[], unsigned
|
Line 2922 rplinit(int argc, char *argv[], unsigned
|
} |
} |
|
|
pthread_mutex_unlock(&((*s_etat_processus).mutex)); |
pthread_mutex_unlock(&((*s_etat_processus).mutex)); |
|
|
|
if ((*s_etat_processus) |
|
.nombre_interruptions_non_affectees != 0) |
|
{ |
|
affectation_interruptions_logicielles( |
|
s_etat_processus); |
|
} |
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
pthread_mutex_lock(&((*s_etat_processus).mutex)); |
pthread_mutex_lock(&((*s_etat_processus).mutex)); |
} |
} |
Line 3402 rplinit(int argc, char *argv[], unsigned
|
Line 3453 rplinit(int argc, char *argv[], unsigned
|
} |
} |
|
|
# ifndef Cygwin |
# ifndef Cygwin |
|
(*s_etat_processus).pile_signal.ss_flags = SS_DISABLE; |
|
sigaltstack(&((*s_etat_processus).pile_signal), NULL); |
free((*s_etat_processus).pile_signal.ss_sp); |
free((*s_etat_processus).pile_signal.ss_sp); |
# endif |
# endif |
|
|
Line 3423 rplinit(int argc, char *argv[], unsigned
|
Line 3476 rplinit(int argc, char *argv[], unsigned
|
# endif |
# endif |
|
|
free((*s_etat_processus).localisation); |
free((*s_etat_processus).localisation); |
free(s_etat_processus); |
|
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
sem_destroy(&semaphore_liste_threads); |
sem_destroy(&semaphore_liste_threads); |
Line 3441 rplinit(int argc, char *argv[], unsigned
|
Line 3493 rplinit(int argc, char *argv[], unsigned
|
sem_gestionnaires_signaux_atomique); |
sem_gestionnaires_signaux_atomique); |
# endif |
# endif |
|
|
|
free(s_etat_processus); |
|
|
# ifdef DEBUG_MEMOIRE |
# ifdef DEBUG_MEMOIRE |
debug_memoire_verification(s_etat_processus); |
debug_memoire_verification(); |
|
analyse_post_mortem(); |
# endif |
# endif |
|
|
return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE); |
return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE); |