--- rpl/src/interruptions.c 2010/05/07 09:17:52 1.15 +++ rpl/src/interruptions.c 2010/05/19 09:22:34 1.16 @@ -1972,25 +1972,11 @@ 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) { - 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); - } + printf("[%d] SIGFSTOP (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + fflush(stdout); } /* @@ -2018,11 +2004,6 @@ interruption5(int signal, siginfo_t *sig 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) @@ -2194,6 +2175,73 @@ interruption10(int signal, siginfo_t *si } deverrouillage_gestionnaire_signaux(); + return; +} + +void +interruption11(int signal, siginfo_t *siginfo, void *context) +{ + pthread_t thread; + struct_processus *s_etat_processus; + + verrouillage_gestionnaire_signaux(); + + if ((*siginfo).si_pid == getpid()) + { + if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) + == NULL) + { + deverrouillage_gestionnaire_signaux(); + return; + } + + (*s_etat_processus).arret_depuis_abort = -1; + + if (((*s_etat_processus).type_debug & d_debug_signaux) != 0) + { + printf("[%d] SIGFABORT (thread %llu)\n", (int) getpid(), + (unsigned long long) pthread_self()); + fflush(stdout); + } + + /* + * var_globale_traitement_retarde_stop : + * 0 -> traitement immédiat + * 1 -> traitement retardé (aucun signal reçu) + * -1 -> traitement retardé (un ou plusieurs signaux stop reçus) + */ + + if ((*s_etat_processus).var_volatile_traitement_retarde_stop == 0) + { + (*s_etat_processus).var_volatile_requete_arret = -1; + } + else + { + (*s_etat_processus).var_volatile_traitement_retarde_stop = -1; + } + } + else + { + if ((s_etat_processus = recherche_thread(getpid(), pthread_self())) + == NULL) + { + deverrouillage_gestionnaire_signaux(); + return; + } + + (*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, signal); + deverrouillage_gestionnaire_signaux(); + return; + } + } + + deverrouillage_gestionnaire_signaux(); return; }