version 1.48, 2011/09/15 17:51:43
|
version 1.52, 2011/09/26 15:57:16
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.3 |
RPL/2 (R) version 4.1.4 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 261 instruction_wait(struct_processus *s_eta
|
Line 261 instruction_wait(struct_processus *s_eta
|
|
|
do |
do |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 270 instruction_wait(struct_processus *s_eta
|
Line 274 instruction_wait(struct_processus *s_eta
|
code_retour = nanosleep(&temporisation, &temporisation); |
code_retour = nanosleep(&temporisation, &temporisation); |
erreur = errno; |
erreur = errno; |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
Line 1444 instruction_write(struct_processus *s_et
|
Line 1455 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
if (sigaction(SIGPIPE, ®istre, NULL) != 0) |
{ |
{ |
Line 1467 instruction_write(struct_processus *s_et
|
Line 1482 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if ((ios == EPIPE) || (ios == ECONNRESET)) |
if ((ios == EPIPE) || (ios == ECONNRESET)) |
Line 1484 instruction_write(struct_processus *s_et
|
Line 1506 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
Line 1537 instruction_write(struct_processus *s_et
|
Line 1563 instruction_write(struct_processus *s_et
|
adresse_unix.sun_path[UNIX_PATH_MAX - 1] = |
adresse_unix.sun_path[UNIX_PATH_MAX - 1] = |
d_code_fin_chaine; |
d_code_fin_chaine; |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1551 instruction_write(struct_processus *s_et
|
Line 1580 instruction_write(struct_processus *s_et
|
{ |
{ |
ios = errno; |
ios = errno; |
|
|
if (pthread_mutex_lock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if ((ios == EPIPE) || (ios == ECONNRESET)) |
if ((ios == EPIPE) || (ios == ECONNRESET)) |
Line 1570 instruction_write(struct_processus *s_et
|
Line 1606 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
else if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
else if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
Line 1594 instruction_write(struct_processus *s_et
|
Line 1637 instruction_write(struct_processus *s_et
|
adresse_ipv4.sin_port = htons(port); |
adresse_ipv4.sin_port = htons(port); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1606 instruction_write(struct_processus *s_et
|
Line 1653 instruction_write(struct_processus *s_et
|
longueur_effective, 0, (struct sockaddr *) |
longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
while(sem_wait(&((*s_etat_processus) |
|
.semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1618 instruction_write(struct_processus *s_et
|
Line 1674 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
else |
else |
Line 1657 instruction_write(struct_processus *s_et
|
Line 1720 instruction_write(struct_processus *s_et
|
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse[i], i++); |
adresse[i], i++); |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1669 instruction_write(struct_processus *s_et
|
Line 1736 instruction_write(struct_processus *s_et
|
longueur_effective, 0, (struct sockaddr *) |
longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
while(sem_wait(&((*s_etat_processus) |
|
.semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus) |
|
.semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
if (errno != EINTR) |
d_es_processus; |
{ |
return; |
(*s_etat_processus).erreur_systeme = |
|
d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1682 instruction_write(struct_processus *s_et
|
Line 1757 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
if (errno != EINTR) |
d_es_processus; |
{ |
return; |
(*s_etat_processus).erreur_systeme = |
|
d_es_processus; |
|
return; |
|
} |
} |
} |
# else |
# else |
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
Line 1884 instruction_wflock(struct_processus *s_e
|
Line 1966 instruction_wflock(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if (lock.l_type == F_UNLCK) |
if (lock.l_type == F_UNLCK) |
Line 2196 instruction_wfproc(struct_processus *s_e
|
Line 2289 instruction_wfproc(struct_processus *s_e
|
registre_instruction_valide; |
registre_instruction_valide; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2205 instruction_wfproc(struct_processus *s_e
|
Line 2302 instruction_wfproc(struct_processus *s_e
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
Line 2454 instruction_wfdata(struct_processus *s_e
|
Line 2558 instruction_wfdata(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus) |
# ifndef SEMAPHORES_NOMMES |
.mutex_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2463 instruction_wfdata(struct_processus *s_e
|
Line 2571 instruction_wfdata(struct_processus *s_e
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
Line 2647 instruction_wfsock(struct_processus *s_e
|
Line 2762 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2661 instruction_wfsock(struct_processus *s_e
|
Line 2779 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if (erreur != EINTR) |
if (erreur != EINTR) |
Line 2691 instruction_wfsock(struct_processus *s_e
|
Line 2816 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
} while(drapeau == d_faux); |
} while(drapeau == d_faux); |
Line 2727 instruction_wfsock(struct_processus *s_e
|
Line 2859 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2741 instruction_wfsock(struct_processus *s_e
|
Line 2876 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if (erreur != EINTR) |
if (erreur != EINTR) |
Line 2771 instruction_wfsock(struct_processus *s_e
|
Line 2913 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
} while(drapeau == d_faux); |
} while(drapeau == d_faux); |
Line 2826 instruction_wfsock(struct_processus *s_e
|
Line 2975 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
drapeau = d_vrai; |
drapeau = d_vrai; |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2839 instruction_wfsock(struct_processus *s_e
|
Line 2991 instruction_wfsock(struct_processus *s_e
|
{ |
{ |
erreur = errno; |
erreur = errno; |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
if (erreur != EINTR) |
if (erreur != EINTR) |
Line 2869 instruction_wfsock(struct_processus *s_e
|
Line 3028 instruction_wfsock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) |
# ifndef SEMAPHORES_NOMMES |
!= 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) |
|
!= 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
} while(drapeau == d_faux); |
} while(drapeau == d_faux); |
Line 3153 instruction_wfpoke(struct_processus *s_e
|
Line 3319 instruction_wfpoke(struct_processus *s_e
|
|
|
do |
do |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 3161 instruction_wfpoke(struct_processus *s_e
|
Line 3331 instruction_wfpoke(struct_processus *s_e
|
|
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
|
|
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
Line 3300 instruction_wfack(struct_processus *s_et
|
Line 3477 instruction_wfack(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 3309 instruction_wfack(struct_processus *s_et
|
Line 3490 instruction_wfack(struct_processus *s_et
|
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
INCR_GRANULARITE(attente.tv_nsec); |
INCR_GRANULARITE(attente.tv_nsec); |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex_fork)) != 0) |
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
|
|