version 1.12, 2010/04/28 07:05:38
|
version 1.22, 2010/06/24 10:10:41
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.15 |
RPL/2 (R) version 4.0.17 |
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 74 lancement_thread(void *argument)
|
Line 74 lancement_thread(void *argument)
|
attente.tv_nsec = GRANULARITE_us * 1000; |
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
s_argument_thread = (struct_descripteur_thread *) argument; |
s_argument_thread = (struct_descripteur_thread *) argument; |
|
s_etat_processus = (*s_argument_thread).s_nouvel_etat_processus; |
(*s_argument_thread).tid = pthread_self(); |
(*s_argument_thread).tid = pthread_self(); |
(*s_argument_thread).thread_actif = d_vrai; |
(*s_argument_thread).thread_actif = d_vrai; |
s_etat_processus = (*s_argument_thread).s_nouvel_etat_processus; |
|
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (pthread_setspecific(semaphore_fork_processus_courant, |
if (pthread_setspecific(semaphore_fork_processus_courant, |
Line 263 lancement_thread(void *argument)
|
Line 263 lancement_thread(void *argument)
|
} |
} |
else |
else |
{ |
{ |
if ((*s_etat_processus).at_exit != NULL) |
if (((*s_etat_processus).var_volatile_alarme == 0) |
|
&& ((*s_etat_processus).arret_depuis_abort == 0) |
|
&& ((*s_etat_processus).at_exit != NULL)) |
{ |
{ |
|
(*s_etat_processus).var_volatile_requete_arret = 0; |
|
|
if (evaluation(s_etat_processus, (*s_etat_processus).at_exit, |
if (evaluation(s_etat_processus, (*s_etat_processus).at_exit, |
'E') == d_erreur) |
'E') == d_erreur) |
{ |
{ |
Line 488 lancement_thread(void *argument)
|
Line 492 lancement_thread(void *argument)
|
} |
} |
else |
else |
{ |
{ |
kill((*(*((struct_processus_fils *) (*(*l_element_courant) |
if ((*s_etat_processus).arret_depuis_abort == -1) |
.donnee).objet)).thread).pid, SIGFSTOP); |
{ |
|
kill((*(*((struct_processus_fils *) (*(*l_element_courant) |
|
.donnee).objet)).thread).pid, SIGFABORT); |
|
} |
|
else |
|
{ |
|
kill((*(*((struct_processus_fils *) (*(*l_element_courant) |
|
.donnee).objet)).thread).pid, SIGFSTOP); |
|
} |
} |
} |
} |
} |
else |
else |
Line 579 lancement_thread(void *argument)
|
Line 591 lancement_thread(void *argument)
|
(*(*l_element_courant).donnee).objet)).thread) |
(*(*l_element_courant).donnee).objet)).thread) |
.thread_actif == d_vrai) |
.thread_actif == d_vrai) |
{ |
{ |
pthread_kill((*(*((struct_processus_fils *) |
if ((*s_etat_processus).arret_depuis_abort == -1) |
(*(*l_element_courant).donnee).objet)).thread).tid, |
{ |
SIGFSTOP); |
pthread_kill((*(*((struct_processus_fils *) |
|
(*(*l_element_courant).donnee).objet)).thread) |
|
.tid, SIGFABORT); |
|
} |
|
else |
|
{ |
|
pthread_kill((*(*((struct_processus_fils *) |
|
(*(*l_element_courant).donnee).objet)).thread) |
|
.tid, SIGFSTOP); |
|
} |
} |
} |
|
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
Line 621 lancement_thread(void *argument)
|
Line 642 lancement_thread(void *argument)
|
l_element_courant = (struct_liste_chainee *) |
l_element_courant = (struct_liste_chainee *) |
(*s_etat_processus).l_base_pile_processus; |
(*s_etat_processus).l_base_pile_processus; |
|
|
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
|
{ |
|
affectation_interruptions_logicielles(s_etat_processus); |
|
} |
|
|
|
registre_stop = (*s_etat_processus) |
registre_stop = (*s_etat_processus) |
.var_volatile_traitement_retarde_stop; |
.var_volatile_traitement_retarde_stop; |
(*s_etat_processus).var_volatile_traitement_retarde_stop = 1; |
(*s_etat_processus).var_volatile_traitement_retarde_stop = 1; |
Line 718 lancement_thread(void *argument)
|
Line 734 lancement_thread(void *argument)
|
} |
} |
|
|
pthread_mutex_unlock(&((*s_etat_processus).mutex)); |
pthread_mutex_unlock(&((*s_etat_processus).mutex)); |
|
|
|
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
|
{ |
|
affectation_interruptions_logicielles(s_etat_processus); |
|
} |
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
pthread_mutex_lock(&((*s_etat_processus).mutex)); |
pthread_mutex_lock(&((*s_etat_processus).mutex)); |
} |
} |
Line 1055 lancement_thread(void *argument)
|
Line 1077 lancement_thread(void *argument)
|
|
|
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)); |
|
|
free((*s_etat_processus).localisation); |
free((*s_etat_processus).localisation); |
free(s_etat_processus); |
free(s_etat_processus); |