version 1.90, 2012/01/05 10:19:05
|
version 1.95, 2012/05/16 14:45:25
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.5 |
RPL/2 (R) version 4.1.8 |
Copyright (C) 1989-2012 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 64 unsigned char *racine_segment;
|
Line 64 unsigned char *racine_segment;
|
static pthread_mutex_t mutex_interruptions |
static pthread_mutex_t mutex_interruptions |
= PTHREAD_MUTEX_INITIALIZER; |
= PTHREAD_MUTEX_INITIALIZER; |
|
|
|
void * |
|
thread_surveillance_signaux(void *argument) |
|
{ |
|
// Chaque kill() ou pthread_kill() incrémente le sémaphore. Lorsque le |
|
// sémaphore est déverrouillé, on part dans un timeout. |
|
// while(sem_wait()) |
|
// { |
|
// nanosleep(); |
|
// if (errno == EINTR) |
|
// { |
|
// continue; |
|
// } |
|
// |
|
// if (sem_trywait() != 0) |
|
// { |
|
// sem_post() |
|
// kill() |
|
// } |
|
// } |
|
pthread_exit(NULL); |
|
} |
|
|
void |
void |
modification_pid_thread_pere(struct_processus *s_etat_processus) |
modification_pid_thread_pere(struct_processus *s_etat_processus) |
{ |
{ |
Line 2274 scrutation_interruptions(struct_processu
|
Line 2296 scrutation_interruptions(struct_processu
|
if (sem_trywait(semaphore_queue_signaux) == 0) |
if (sem_trywait(semaphore_queue_signaux) == 0) |
# endif |
# endif |
{ |
{ |
if ((*s_queue_signaux).pointeur_lecture != |
while((*s_queue_signaux).pointeur_lecture != |
(*s_queue_signaux).pointeur_ecriture) |
(*s_queue_signaux).pointeur_ecriture) |
{ |
{ |
// Il y a un signal en attente dans le segment partagé. On le |
// Il y a un signal en attente dans le segment partagé. On le |
Line 2300 scrutation_interruptions(struct_processu
|
Line 2322 scrutation_interruptions(struct_processu
|
|
|
if (pthread_mutex_trylock(&mutex_interruptions) == 0) |
if (pthread_mutex_trylock(&mutex_interruptions) == 0) |
{ |
{ |
if ((*s_etat_processus).pointeur_signal_lecture != |
while((*s_etat_processus).pointeur_signal_lecture != |
(*s_etat_processus).pointeur_signal_ecriture) |
(*s_etat_processus).pointeur_signal_ecriture) |
{ |
{ |
// Il y a un signal dans la queue du thread courant. On le traite. |
// Il y a un signal dans la queue du thread courant. On le traite. |