--- rpl/src/instructions_d5.c 2010/08/17 11:59:27 1.37 +++ rpl/src/instructions_d5.c 2010/09/23 15:27:37 1.43 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.18 + RPL/2 (R) version 4.0.20 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -1159,17 +1159,6 @@ instruction_detach(struct_processus *s_e verrouillage_threads_concurrents(s_etat_processus); (*s_argument_thread).pid = fork(); - -# ifdef OS2 - if ((*s_argument_thread).pid == 0) - { - sem_init(&semaphore_liste_threads, 0, 1); - sem_init(&semaphore_gestionnaires_signaux, 0, 0); - sem_init(&semaphore_gestionnaires_signaux_atomique, 0, 1); - sem_init(&((*s_etat_processus).semaphore_fork), 0, 0); - } -# endif - deverrouillage_threads_concurrents(s_etat_processus); pthread_sigmask(SIG_SETMASK, &oldset2, NULL); @@ -1183,6 +1172,12 @@ instruction_detach(struct_processus *s_e pthread_mutex_init(&((*s_argument_thread).mutex), &attributs_mutex); pthread_mutexattr_destroy(&attributs_mutex); + pthread_mutexattr_init(&attributs_mutex); + pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&((*s_argument_thread).mutex_nombre_references), + &attributs_mutex); + pthread_mutexattr_destroy(&attributs_mutex); + if ((*s_argument_thread).pid > 0) { /* @@ -1608,6 +1603,7 @@ instruction_detach(struct_processus *s_e } (*s_etat_processus).var_volatile_processus_pere = 0; + (*s_etat_processus).var_volatile_processus_racine = 0; // On réinitialise toutes les interruptions. @@ -2570,10 +2566,6 @@ instruction_detach(struct_processus *s_e pthread_mutex_unlock(&((*s_etat_processus).mutex)); -# ifdef _BROKEN_SIGINFO - destruction_fifos_signaux(s_etat_processus); -# endif - l_element_courant = (*s_etat_processus).s_sockets; while(l_element_courant != NULL) @@ -2946,6 +2938,10 @@ instruction_detach(struct_processus *s_e clear_history(); +# ifdef _BROKEN_SIGINFO + destruction_fifos_signaux(s_etat_processus); +# endif + free(s_etat_processus); # ifdef DEBUG_MEMOIRE