--- rpl/src/instructions_r6.c 2015/01/05 13:12:39 1.59 +++ rpl/src/instructions_r6.c 2020/01/10 11:15:48 1.79 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.19 - Copyright (C) 1989-2015 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.32 + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -316,19 +316,6 @@ instruction_recv(struct_processus *s_eta return; } -# 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) - { - (*s_etat_processus).erreur_systeme = d_es_processus; - return; - } - } - if (pthread_mutex_lock(&((*(*((struct_processus_fils *) (*(*l_element_courant).donnee).objet)).thread).mutex)) != 0) { @@ -346,8 +333,14 @@ instruction_recv(struct_processus *s_eta return; } + if (pthread_mutex_lock(&mutex_sigaction) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + action.sa_handler = SIG_IGN; - action.sa_flags = SA_ONSTACK; + action.sa_flags = 0; if (sigaction(SIGPIPE, &action, ®istre) != 0) { @@ -370,20 +363,11 @@ instruction_recv(struct_processus *s_eta profilage(s_etat_processus, NULL); } + pthread_mutex_unlock(&mutex_sigaction); (*s_etat_processus).erreur_systeme = d_es_signal; return; } -# 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; - return; - } - while((longueur_ecriture = write_atomic(s_etat_processus, (*(*((struct_processus_fils *) (*(*l_element_courant) .donnee).objet)).thread).pipe_nombre_injections[1], "+", @@ -404,6 +388,7 @@ instruction_recv(struct_processus *s_eta { if (errno != EINTR) { + pthread_mutex_unlock(&mutex_sigaction); (*s_etat_processus).erreur_systeme = d_es_processus; return; } @@ -433,6 +418,12 @@ instruction_recv(struct_processus *s_eta return; } + if (pthread_mutex_unlock(&mutex_sigaction) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if (pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus)) != 0) { @@ -1352,7 +1343,7 @@ instruction_rdgn(struct_processus *s_eta if ((*s_objet_argument).type == CHN) { - if ((requete = conversion_majuscule((unsigned char *) + if ((requete = conversion_majuscule(s_etat_processus, (unsigned char *) (*s_objet_argument).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1388,7 +1379,7 @@ instruction_rdgn(struct_processus *s_eta else { if (((*s_objet_resultat).objet = conversion_majuscule( - (unsigned char *) gsl_rng_name( + s_etat_processus, (unsigned char *) gsl_rng_name( (*s_etat_processus).generateur_aleatoire))) == NULL) { (*s_etat_processus).erreur_systeme = @@ -1642,15 +1633,15 @@ instruction_recode(struct_processus *s_e ((*s_objet_argument_2).type == CHN) && ((*s_objet_argument_3).type == CHN)) { - if ((encodage_source = conversion_majuscule((unsigned char *) - (*s_objet_argument_2).objet)) == NULL) + if ((encodage_source = conversion_majuscule(s_etat_processus, + (unsigned char *) (*s_objet_argument_2).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } - if ((encodage_destination = conversion_majuscule((unsigned char *) - (*s_objet_argument_1).objet)) == NULL) + if ((encodage_destination = conversion_majuscule(s_etat_processus, + (unsigned char *) (*s_objet_argument_1).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return;