version 1.42, 2010/09/23 15:27:41
|
version 1.53, 2011/06/21 15:26:35
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.20 |
RPL/2 (R) version 4.1.0.prerelease.2 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 803 liberation_threads(struct_processus *s_e
|
Line 803 liberation_threads(struct_processus *s_e
|
} |
} |
} |
} |
|
|
for(i = 0; i < (*s_etat_processus).nombre_variables; i++) |
liberation_arbre_variables(s_etat_processus, |
{ |
(*s_etat_processus).s_arbre_variables, d_faux); |
pthread_mutex_trylock(&((*(*s_etat_processus) |
|
.s_liste_variables[i].objet).mutex)); |
|
pthread_mutex_unlock(&((*(*s_etat_processus) |
|
.s_liste_variables[i].objet).mutex)); |
|
|
|
// Les variables de niveau 0 sont des définitions qui |
|
// ne sont pas copiées entre threads. |
|
if ((*s_etat_processus).s_liste_variables[i].niveau > 0) |
|
{ |
|
liberation(s_etat_processus, |
|
(*s_etat_processus).s_liste_variables[i].objet); |
|
} |
|
|
|
free((*s_etat_processus).s_liste_variables[i].nom); |
|
} |
|
|
|
free((*s_etat_processus).s_liste_variables); |
|
|
|
for(i = 0; i < (*s_etat_processus).nombre_variables_statiques; i++) |
for(i = 0; i < (*s_etat_processus).nombre_variables_statiques; i++) |
{ |
{ |
Line 1748 interruption1(SIGHANDLER_ARGS)
|
Line 1731 interruption1(SIGHANDLER_ARGS)
|
verrouillage_gestionnaire_signaux(); |
verrouillage_gestionnaire_signaux(); |
|
|
# ifdef _BROKEN_SIGINFO |
# ifdef _BROKEN_SIGINFO |
if (signal == SIGINT) |
if ((signal == SIGINT) || (signal == SIGTERM)) |
{ |
{ |
// Si l'interruption provient du clavier, il n'y a pas eu d'appel |
// Si l'interruption provient du clavier, il n'y a pas eu d'appel |
// à queue_in(). |
// à queue_in(). |
Line 1812 interruption1(SIGHANDLER_ARGS)
|
Line 1795 interruption1(SIGHANDLER_ARGS)
|
} |
} |
|
|
case SIGINT : |
case SIGINT : |
|
case SIGTERM : |
{ |
{ |
/* |
/* |
* Une vieille spécification POSIX permet au pointeur siginfo |
* Une vieille spécification POSIX permet au pointeur siginfo |
Line 1837 interruption1(SIGHANDLER_ARGS)
|
Line 1821 interruption1(SIGHANDLER_ARGS)
|
|
|
if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) |
if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) |
{ |
{ |
printf("[%d] SIGINT (thread %llu)\n", (int) getpid(), |
if (signal == SIGINT) |
(unsigned long long) pthread_self()); |
{ |
|
printf("[%d] SIGINT (thread %llu)\n", (int) getpid(), |
|
(unsigned long long) pthread_self()); |
|
} |
|
else |
|
{ |
|
printf("[%d] SIGTERM (thread %llu)\n", (int) getpid(), |
|
(unsigned long long) pthread_self()); |
|
} |
|
|
fflush(stdout); |
fflush(stdout); |
} |
} |
|
|
Line 1860 interruption1(SIGHANDLER_ARGS)
|
Line 1853 interruption1(SIGHANDLER_ARGS)
|
return; |
return; |
} |
} |
|
|
if (strncmp(getenv("LANG"), "fr", 2) == 0) |
if (signal == SIGINT) |
{ |
{ |
printf("+++Interruption\n"); |
if (strncmp(getenv("LANG"), "fr", 2) == 0) |
} |
{ |
else |
printf("+++Interruption\n"); |
{ |
} |
printf("+++Interrupt\n"); |
else |
} |
{ |
|
printf("+++Interrupt\n"); |
|
} |
|
|
fflush(stdout); |
fflush(stdout); |
|
} |
|
|
(*s_etat_processus).var_volatile_requete_arret = -1; |
(*s_etat_processus).var_volatile_requete_arret = -1; |
(*s_etat_processus).var_volatile_alarme = -1; |
(*s_etat_processus).var_volatile_alarme = -1; |