--- rpl/src/rpl.c 2016/03/22 17:12:14 1.183 +++ rpl/src/rpl.c 2016/10/11 11:57:02 1.188 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.25 + RPL/2 (R) version 4.1.26 Copyright (C) 1989-2016 Dr. BERTRAND Joël This file is part of RPL/2. @@ -27,6 +27,11 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wclobbered" +#ifdef BROKEN_SIGSEGV +# undef HAVE_STACK_OVERFLOW_RECOVERY +# undef HAVE_SIGSEGV_RECOVERY +#endif + /* ================================================================================ @@ -126,6 +131,10 @@ rplinit(int argc, char *argv[], char *en nombre_thread_surveillance_processus = 0; pid_processus_pere = getpid(); +# ifdef DEBUG_PROC + __proc = 0; +# endif + # ifdef DEBUG_MEMOIRE debug_memoire_initialisation(); # endif @@ -672,7 +681,7 @@ rplinit(int argc, char *argv[], char *en return(EXIT_FAILURE); } - if (sigaction(SIGALRM, &action, NULL) != 0) + if (sigaction(SIGUSR2, &action, NULL) != 0) { # ifndef SEMAPHORES_NOMMES sem_post(&((*s_etat_processus).semaphore_fork)); @@ -706,7 +715,7 @@ rplinit(int argc, char *argv[], char *en } signal_test = SIGTEST; - raise(SIGALRM); + raise(SIGUSR2); attente.tv_sec = 0; attente.tv_nsec = 1000000; @@ -716,7 +725,7 @@ rplinit(int argc, char *argv[], char *en nanosleep(&attente, NULL); } - if (signal_test != SIGALRM) + if (signal_test != SIGUSR2) { # ifndef SEMAPHORES_NOMMES sem_post(&((*s_etat_processus).semaphore_fork)); @@ -2448,7 +2457,7 @@ rplinit(int argc, char *argv[], char *en if (debug == d_faux) { -# ifdef HAVE_SIGSEGV_RECOVERY +# if defined(HAVE_SIGSEGV_RECOVERY) if (sigsegv_install_handler(interruption_violation_access) != 0) { # ifndef SEMAPHORES_NOMMES @@ -5697,6 +5706,15 @@ rplinit(int argc, char *argv[], char *en retrait_thread(s_etat_processus); + attente.tv_sec = 0; + attente.tv_nsec = GRANULARITE_us * 1000; + + while(nombre_thread_surveillance_processus != 0) + { + nanosleep(&attente, NULL); + INCR_GRANULARITE(attente.tv_nsec); + } + pthread_mutex_destroy(&((*s_etat_processus).mutex_pile_processus)); pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation)); pthread_mutex_destroy(&((*s_etat_processus).mutex_interruptions));