--- rpl/src/interruptions.c 2010/06/04 07:48:20 1.20 +++ rpl/src/interruptions.c 2010/08/13 21:00:37 1.29 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.16 + RPL/2 (R) version 4.0.18 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -20,7 +20,7 @@ */ -#include "rpl.conv.h" +#include "rpl-conv.h" /* @@ -125,7 +125,6 @@ insertion_thread(struct_processus *s_eta } (*l_nouvel_objet).suivant = liste_threads; - liste_threads = l_nouvel_objet; # ifndef SEMAPHORES_NOMMES @@ -184,7 +183,10 @@ insertion_thread_surveillance(struct_pro } } -printf("<1> +1 %d\n", (*s_argument_thread).nombre_references); + pthread_mutex_lock(&((*s_argument_thread).mutex)); + (*s_argument_thread).nombre_references++; + pthread_mutex_unlock(&((*s_argument_thread).mutex)); + (*l_nouvel_objet).suivant = liste_threads_surveillance; (*l_nouvel_objet).donnee = (void *) s_argument_thread; @@ -391,13 +393,11 @@ retrait_thread_surveillance(struct_proce } (*s_argument_thread).nombre_references--; -printf("<3> -1 %d %p\n", (*s_argument_thread).nombre_references, s_argument_thread); BUG((*s_argument_thread).nombre_references < 0, printf("(*s_argument_thread).nombre_references = %d\n", (int) (*s_argument_thread).nombre_references)); -printf("retrait_thread_surveillance : %d\n", (*s_argument_thread).nombre_references); if ((*s_argument_thread).nombre_references == 0) { if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) @@ -684,7 +684,6 @@ liberation_threads(struct_processus *s_e } (*s_argument_thread).nombre_references--; -printf("<1> -1 %d %p\n", (*s_argument_thread).nombre_references, s_argument_thread); BUG((*s_argument_thread).nombre_references < 0, printf("(*s_argument_thread).nombre_references = %d\n", @@ -1359,7 +1358,6 @@ printf("<1> -1 %d %p\n", (*s_argument_th } (*s_argument_thread).nombre_references--; -printf("<2> -1 %d %p\n", (*s_argument_thread).nombre_references, s_argument_thread); BUG((*s_argument_thread).nombre_references < 0, printf("(*s_argument_thread).nombre_references = %d\n", @@ -1735,6 +1733,10 @@ interruption1(int signal, siginfo_t *sig volatile sig_atomic_t exclusion = 0; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); switch(signal) @@ -1870,6 +1872,10 @@ interruption2(int signal, siginfo_t *sig pthread_t thread; struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if (siginfo == NULL) @@ -1943,6 +1949,10 @@ interruption3(int signal, siginfo_t *sig static int compteur = 0; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2001,6 +2011,10 @@ interruption4(int signal, siginfo_t *sig { struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2030,6 +2044,10 @@ interruption5(int signal, siginfo_t *sig pthread_t thread; struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((*siginfo).si_pid == getpid()) @@ -2092,6 +2110,10 @@ interruption6(int signal, siginfo_t *sig { struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2116,6 +2138,10 @@ interruption7(int signal, siginfo_t *sig { struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2144,6 +2170,10 @@ interruption8(int signal, siginfo_t *sig pthread_t thread; struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((*siginfo).si_pid == getpid()) @@ -2186,6 +2216,10 @@ interruption9(int signal, siginfo_t *sig { struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2215,6 +2249,10 @@ interruption10(int signal, siginfo_t *si unsigned char nom[8 + 64 + 1]; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) == NULL) @@ -2253,6 +2291,10 @@ interruption11(int signal, siginfo_t *si pthread_t thread; struct_processus *s_etat_processus; +# ifdef _BROKEN_SIGINFO + (*siginfo).si_pid=getpid(); +# endif + verrouillage_gestionnaire_signaux(); if ((*siginfo).si_pid == getpid())