version 1.54, 2011/09/20 15:45:53
|
version 1.66, 2012/10/01 11:05:02
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.3 |
RPL/2 (R) version 4.1.11 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2012 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 73 lancement_thread(void *argument)
|
Line 73 lancement_thread(void *argument)
|
|
|
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_etat_processus = (*s_argument_thread).s_nouvel_etat_processus; |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
sem_init(&((*s_etat_processus).semaphore_fork), 0, 0); |
|
# else |
|
if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(), |
|
pthread_self(), SEM_FORK)) == SEM_FAILED) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return(NULL); |
|
} |
|
# endif |
|
|
(*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; |
|
|
Line 92 lancement_thread(void *argument)
|
Line 104 lancement_thread(void *argument)
|
|
|
(*s_argument_thread).thread_actif = d_faux; |
(*s_argument_thread).thread_actif = d_faux; |
|
|
tid_final = -2; |
tid_final = (pthread_t) -2; |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
while((longueur_ecriture = write_atomic(s_etat_processus, |
(*s_argument_thread).pipe_nombre_interruptions_attente[1], |
(*s_argument_thread).pipe_nombre_interruptions_attente[1], |
Line 207 lancement_thread(void *argument)
|
Line 219 lancement_thread(void *argument)
|
pthread_cancel((*s_etat_processus).thread_fusible); |
pthread_cancel((*s_etat_processus).thread_fusible); |
} |
} |
|
|
tid_final = -2; |
tid_final = (pthread_t) -2; |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
while((longueur_ecriture = write_atomic(s_etat_processus, |
(*s_argument_thread).pipe_nombre_interruptions_attente[1], |
(*s_argument_thread).pipe_nombre_interruptions_attente[1], |
Line 987 lancement_thread(void *argument)
|
Line 999 lancement_thread(void *argument)
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
sem_destroy(&((*s_etat_processus).semaphore_fork)); |
sem_destroy(&((*s_etat_processus).semaphore_fork)); |
# else |
# else |
sem_destroy2((*s_etat_processus).semaphore_fork, getpid(), SEM_FORK); |
sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), |
|
pthread_self(), SEM_FORK); |
# endif |
# endif |
|
|
liberation_contexte_cas(s_etat_processus); |
liberation_contexte_cas(s_etat_processus); |