--- rpl/src/interruptions.c 2012/12/19 09:58:27 1.113 +++ rpl/src/interruptions.c 2013/03/24 22:06:10 1.123 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.12 - Copyright (C) 1989-2012 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.13 + Copyright (C) 1989-2013 Dr. BERTRAND Joël This file is part of RPL/2. @@ -81,6 +81,11 @@ thread_surveillance_signaux(void *argume volatile struct_liste_chainee_volatile *l_element_courant; + sigset_t set; + + sigfillset(&set); + pthread_sigmask(SIG_BLOCK, &set, NULL); + s_etat_processus = (struct_processus *) argument; for(;;) @@ -94,17 +99,17 @@ thread_surveillance_signaux(void *argume if (sem_wait(semaphore_signalisation) == 0) # endif { - if ((*s_queue_signaux).requete_arret == d_vrai) - { - break; - } - # if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&(*s_queue_signaux).signalisation); # else sem_post(semaphore_signalisation); # endif + if ((*s_queue_signaux).requete_arret == d_vrai) + { + break; + } + nombre_signaux_envoyes = 0; sched_yield(); @@ -550,7 +555,7 @@ liberation_threads(struct_processus *s_e struct_liste_variables_statiques *l_element_statique_courant; struct_liste_variables_statiques *l_element_statique_suivant; - unsigned long i; + integer8 i; void *element_candidat; void *element_courant; @@ -2404,8 +2409,9 @@ signal_hup(struct_processus *s_etat_proc return; } - snprintf(nom, 8 + 64 + 1, "rpl-out-%lu-%lu", (unsigned long) getpid(), - (unsigned long) pthread_self()); + snprintf(nom, 8 + 64 + 1, "rpl-out-%llu-%llu", + (unsigned long long) getpid(), + (unsigned long long) pthread_self()); if ((fichier = fopen(nom, "w+")) != NULL) { @@ -2946,6 +2952,12 @@ envoi_signal_thread(pthread_t tid, enum struct_processus *s_etat_processus; + if (pthread_mutex_lock(&mutex_interruptions) != 0) + { + pthread_mutex_unlock(&mutex_liste_threads); + return(1); + } + if (pthread_mutex_lock(&mutex_liste_threads) != 0) { return(1); @@ -2969,12 +2981,6 @@ envoi_signal_thread(pthread_t tid, enum { pthread_mutex_unlock(&mutex_liste_threads); return(1); - } - - if (pthread_mutex_lock(&mutex_interruptions) != 0) - { - pthread_mutex_unlock(&mutex_liste_threads); - return(1); } s_etat_processus = (*((struct_thread *) (*l_element_courant).donnee))