version 1.37, 2010/08/17 11:59:27
|
version 1.46, 2010/12/21 13:47:19
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.18 |
RPL/2 (R) version 4.0.20 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 1159 instruction_detach(struct_processus *s_e
|
Line 1159 instruction_detach(struct_processus *s_e
|
|
|
verrouillage_threads_concurrents(s_etat_processus); |
verrouillage_threads_concurrents(s_etat_processus); |
(*s_argument_thread).pid = fork(); |
(*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); |
deverrouillage_threads_concurrents(s_etat_processus); |
|
|
pthread_sigmask(SIG_SETMASK, &oldset2, NULL); |
pthread_sigmask(SIG_SETMASK, &oldset2, NULL); |
Line 1183 instruction_detach(struct_processus *s_e
|
Line 1172 instruction_detach(struct_processus *s_e
|
pthread_mutex_init(&((*s_argument_thread).mutex), &attributs_mutex); |
pthread_mutex_init(&((*s_argument_thread).mutex), &attributs_mutex); |
pthread_mutexattr_destroy(&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) |
if ((*s_argument_thread).pid > 0) |
{ |
{ |
/* |
/* |
Line 1608 instruction_detach(struct_processus *s_e
|
Line 1603 instruction_detach(struct_processus *s_e
|
} |
} |
|
|
(*s_etat_processus).var_volatile_processus_pere = 0; |
(*s_etat_processus).var_volatile_processus_pere = 0; |
|
(*s_etat_processus).var_volatile_processus_racine = 0; |
|
|
// On réinitialise toutes les interruptions. |
// On réinitialise toutes les interruptions. |
|
|
Line 2570 instruction_detach(struct_processus *s_e
|
Line 2566 instruction_detach(struct_processus *s_e
|
|
|
pthread_mutex_unlock(&((*s_etat_processus).mutex)); |
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; |
l_element_courant = (*s_etat_processus).s_sockets; |
|
|
while(l_element_courant != NULL) |
while(l_element_courant != NULL) |
Line 2869 instruction_detach(struct_processus *s_e
|
Line 2861 instruction_detach(struct_processus *s_e
|
|
|
liberation(s_etat_processus, s_objet); |
liberation(s_etat_processus, s_objet); |
|
|
# if !defined(Cygwin) && !defined(OpenBSD) |
|
(*s_etat_processus).pile_signal.ss_flags = SS_DISABLE; |
|
sigaltstack(&((*s_etat_processus).pile_signal), NULL); |
|
free((*s_etat_processus).pile_signal.ss_sp); |
|
# endif |
|
|
|
free((*s_etat_processus).definitions_chainees); |
free((*s_etat_processus).definitions_chainees); |
free((*s_etat_processus).nom_fichier_historique); |
free((*s_etat_processus).nom_fichier_historique); |
|
|
Line 2946 instruction_detach(struct_processus *s_e
|
Line 2932 instruction_detach(struct_processus *s_e
|
|
|
clear_history(); |
clear_history(); |
|
|
|
# ifdef _BROKEN_SIGINFO |
|
destruction_fifos_signaux(s_etat_processus); |
|
# endif |
|
|
free(s_etat_processus); |
free(s_etat_processus); |
|
|
# ifdef DEBUG_MEMOIRE |
# ifdef DEBUG_MEMOIRE |
Line 3025 instruction_detach(struct_processus *s_e
|
Line 3015 instruction_detach(struct_processus *s_e
|
|
|
// Être sûr que le processus fils soit déjà présent... |
// Être sûr que le processus fils soit déjà présent... |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
while(kill((*s_argument_thread).pid, 0) != 0) |
while(kill((*s_argument_thread).pid, 0) != 0) |
{ |
{ |
//if ((errno != ESRCH) && (errno != EAGAIN)) |
//if ((errno != ESRCH) && (errno != EAGAIN)) |
Line 3036 instruction_detach(struct_processus *s_e
|
Line 3029 instruction_detach(struct_processus *s_e
|
} |
} |
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
} |
} |
|
|
// Le fils peut être présent sans être en attente du signal de départ. |
// Le fils peut être présent sans être en attente du signal de départ. |