--- rpl/src/interruptions.c 2010/04/21 13:45:50 1.9 +++ rpl/src/interruptions.c 2010/04/29 15:47:25 1.12 @@ -394,6 +394,11 @@ retrait_thread_surveillance(struct_proce if (pthread_mutex_lock(&((*s_argument_thread).mutex)) != 0) { +# ifndef SEMAPHORES_NOMMES + sem_post(&semaphore_liste_threads); +# else + sem_post(semaphore_liste_threads); +# endif pthread_sigmask(SIG_SETMASK, &oldset, NULL); sigpending(&set); @@ -411,6 +416,11 @@ retrait_thread_surveillance(struct_proce { if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) { +# ifndef SEMAPHORES_NOMMES + sem_post(&semaphore_liste_threads); +# else + sem_post(semaphore_liste_threads); +# endif pthread_sigmask(SIG_SETMASK, &oldset, NULL); sigpending(&set); @@ -425,6 +435,11 @@ retrait_thread_surveillance(struct_proce { if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) { +# ifndef SEMAPHORES_NOMMES + sem_post(&semaphore_liste_threads); +# else + sem_post(semaphore_liste_threads); +# endif pthread_sigmask(SIG_SETMASK, &oldset, NULL); sigpending(&set); @@ -1291,6 +1306,7 @@ liberation_threads(struct_processus *s_e if (pthread_mutex_lock(&((*s_argument_thread).mutex)) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; + sem_post(&semaphore_liste_threads); return; } @@ -1305,6 +1321,7 @@ liberation_threads(struct_processus *s_e if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; + sem_post(&semaphore_liste_threads); return; } @@ -1316,6 +1333,7 @@ liberation_threads(struct_processus *s_e if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; + sem_post(&semaphore_liste_threads); return; } } @@ -1957,11 +1975,25 @@ interruption5(int signal, siginfo_t *sig return; } + if (signal == SIGFABORT) + { + (*s_etat_processus).arret_depuis_abort = -1; + } + if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) { - printf("[%d] SIGFSTOP (thread %llu)\n", (int) getpid(), - (unsigned long long) pthread_self()); - fflush(stdout); + if (signal == SIGFSTOP) + { + printf("[%d] SIGFSTOP (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + fflush(stdout); + } + else + { + printf("[%d] SIGFABORT (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + fflush(stdout); + } } /* @@ -1982,11 +2014,23 @@ interruption5(int signal, siginfo_t *sig } else { + if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) + == NULL) + { + deverrouillage_gestionnaire_signaux(); + return; + } + + if (signal == SIGFABORT) + { + (*s_etat_processus).arret_depuis_abort = -1; + } + // Envoi d'un signal au thread maître du groupe. if (recherche_thread_principal(getpid(), &thread) == d_vrai) { - pthread_kill(thread, SIGFSTOP); + pthread_kill(thread, signal); deverrouillage_gestionnaire_signaux(); return; } @@ -2110,7 +2154,7 @@ interruption9(int signal, siginfo_t *sig fflush(stdout); } - pthread_kill((*s_etat_processus).tid_processus_pere, SIGFSTOP); + pthread_kill((*s_etat_processus).tid_processus_pere, SIGFABORT); deverrouillage_gestionnaire_signaux(); return; }