--- rpl/src/rpl.c 2016/03/15 16:31:15 1.178 +++ rpl/src/rpl.c 2016/03/22 18:51:54 1.184 @@ -123,6 +123,7 @@ rplinit(int argc, char *argv[], char *en errno = 0; s_queue_signaux = NULL; routine_recursive = 0; + nombre_thread_surveillance_processus = 0; pid_processus_pere = getpid(); # ifdef DEBUG_MEMOIRE @@ -514,39 +515,6 @@ rplinit(int argc, char *argv[], char *en } # endif - if (lancement_thread_signaux(s_etat_processus) != d_absence_erreur) - { -# ifndef SEMAPHORES_NOMMES - sem_post(&((*s_etat_processus).semaphore_fork)); - sem_destroy(&((*s_etat_processus).semaphore_fork)); -# else - sem_post((*s_etat_processus).semaphore_fork); - sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), - pthread_self(), SEM_FORK); -# endif - - liberation_contexte_cas(s_etat_processus); - destruction_queue_signaux(s_etat_processus); - -# ifdef HAVE_STACK_OVERFLOW_RECOVERY - stackoverflow_deinstall_handler(); -# endif - - erreur = d_es_signal; - - if ((*s_etat_processus).langue == 'F') - { - printf("+++Système : Initialisation des signaux POSIX " - "impossible\n"); - } - else - { - printf("+++System : Initialization of POSIX signals failed\n"); - } - - return(EXIT_FAILURE); - } - action.sa_handler = interruption1; action.sa_flags = 0; @@ -4990,7 +4958,7 @@ rplinit(int argc, char *argv[], char *en (*(*((struct_processus_fils *) (*(*((struct_liste_chainee *) l_element_courant)).donnee).objet)) - .thread).pid, rpl_sigurg); + .thread).pid, rpl_sigurg, d_faux); } else { @@ -5001,7 +4969,7 @@ rplinit(int argc, char *argv[], char *en (*(*((struct_processus_fils *) (*(*((struct_liste_chainee *) l_element_courant)).donnee).objet)) - .thread).pid, rpl_sigabort); + .thread).pid, rpl_sigabort, d_faux); } else { @@ -5009,7 +4977,7 @@ rplinit(int argc, char *argv[], char *en (*(*((struct_processus_fils *) (*(*((struct_liste_chainee *) l_element_courant)).donnee).objet)) - .thread).pid, rpl_sigstop); + .thread).pid, rpl_sigstop, d_faux); } } } @@ -5729,6 +5697,8 @@ rplinit(int argc, char *argv[], char *en retrait_thread(s_etat_processus); + while(nombre_thread_surveillance_processus != 0); + 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)); @@ -5762,11 +5732,13 @@ rplinit(int argc, char *argv[], char *en erreur = d_erreur; } - sys_free(arg_exec); liberation_etat_processus_readline(); + liberation_allocateur_buffer(s_etat_processus); pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer)); + sys_free(s_etat_processus); + sys_free(arg_exec); # ifdef DEBUG_MEMOIRE debug_memoire_verification();