version 1.27, 2010/06/17 11:00:23
|
version 1.35, 2010/08/13 21:00:37
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.16 |
RPL/2 (R) version 4.0.18 |
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 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 890 instruction_detach(struct_processus *s_e
|
Line 890 instruction_detach(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
|
# ifdef _BROKEN_SIGINFO |
|
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
printf("+++Attention : Support des processus multiples indisponible\n"); |
|
} |
|
else |
|
{ |
|
printf("+++Attention : Multiprocess unavailable\n"); |
|
} |
|
|
|
return; |
|
# endif |
|
|
if (test_cfsf(s_etat_processus, 31) == d_vrai) |
if (test_cfsf(s_etat_processus, 31) == d_vrai) |
{ |
{ |
if (empilement_pile_last(s_etat_processus, 1) == d_erreur) |
if (empilement_pile_last(s_etat_processus, 1) == d_erreur) |
Line 1159 instruction_detach(struct_processus *s_e
|
Line 1172 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 1275 instruction_detach(struct_processus *s_e
|
Line 1299 instruction_detach(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
|
# ifndef OS2 |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 1293 instruction_detach(struct_processus *s_e
|
Line 1318 instruction_detach(struct_processus *s_e
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
# endif |
|
|
(*s_argument_thread).s_etat_processus = s_etat_processus; |
(*s_argument_thread).s_etat_processus = s_etat_processus; |
|
|
Line 1589 instruction_detach(struct_processus *s_e
|
Line 1615 instruction_detach(struct_processus *s_e
|
|
|
liberation(s_etat_processus, (*s_etat_processus).at_exit); |
liberation(s_etat_processus, (*s_etat_processus).at_exit); |
(*s_etat_processus).at_exit = NULL; |
(*s_etat_processus).at_exit = NULL; |
|
liberation(s_etat_processus, (*s_etat_processus).at_poke); |
|
(*s_etat_processus).at_poke = NULL; |
|
(*s_etat_processus).traitement_at_poke = 'N'; |
|
|
for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++) |
for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++) |
{ |
{ |
Line 1754 instruction_detach(struct_processus *s_e
|
Line 1783 instruction_detach(struct_processus *s_e
|
} |
} |
|
|
free(s_argument_thread2); |
free(s_argument_thread2); |
|
free((*(*l_element_courant).donnee).objet); |
|
free((*l_element_courant).donnee); |
} |
} |
|
|
l_element_suivant = (*l_element_courant).suivant; |
l_element_suivant = (*l_element_courant).suivant; |
Line 2089 instruction_detach(struct_processus *s_e
|
Line 2120 instruction_detach(struct_processus *s_e
|
} |
} |
|
|
liberation(s_etat_processus, (*s_etat_processus).at_exit); |
liberation(s_etat_processus, (*s_etat_processus).at_exit); |
|
liberation(s_etat_processus, (*s_etat_processus).at_poke); |
|
|
l_element_courant = (*s_etat_processus).liste_mutexes; |
l_element_courant = (*s_etat_processus).liste_mutexes; |
while(l_element_courant != NULL) |
while(l_element_courant != NULL) |
Line 2802 instruction_detach(struct_processus *s_e
|
Line 2834 instruction_detach(struct_processus *s_e
|
|
|
liberation(s_etat_processus, s_objet); |
liberation(s_etat_processus, s_objet); |
|
|
# ifndef Cygwin |
# if !defined(Cygwin) |
(*s_etat_processus).pile_signal.ss_flags = SS_DISABLE; |
(*s_etat_processus).pile_signal.ss_flags = SS_DISABLE; |
sigaltstack(&((*s_etat_processus).pile_signal), NULL); |
sigaltstack(&((*s_etat_processus).pile_signal), NULL); |
free((*s_etat_processus).pile_signal.ss_sp); |
free((*s_etat_processus).pile_signal.ss_sp); |
Line 2847 instruction_detach(struct_processus *s_e
|
Line 2879 instruction_detach(struct_processus *s_e
|
retrait_thread(s_etat_processus); |
retrait_thread(s_etat_processus); |
|
|
pthread_mutex_destroy(&((*s_etat_processus).mutex)); |
pthread_mutex_destroy(&((*s_etat_processus).mutex)); |
|
pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation)); |
pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes)); |
pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes)); |
|
|
pthread_key_delete(semaphore_fork_processus_courant); |
pthread_key_delete(semaphore_fork_processus_courant); |