--- rpl/src/interruptions.c 2012/07/04 13:02:49 1.99 +++ rpl/src/interruptions.c 2012/10/04 15:21:26 1.103 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.9 + RPL/2 (R) version 4.1.11 Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -88,7 +88,7 @@ thread_surveillance_signaux(void *argume attente.tv_sec = 0; attente.tv_nsec = GRANULARITE_us * 1000; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_wait(&(*s_queue_signaux).signalisation) == 0) # else if(sem_wait(semaphore_signalisation) == 0) @@ -99,7 +99,7 @@ thread_surveillance_signaux(void *argume break; } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&(*s_queue_signaux).signalisation); # else sem_post(semaphore_signalisation); @@ -112,7 +112,7 @@ thread_surveillance_signaux(void *argume // affectée au processus courant pour vérifier s'il y a quelque // chose à traiter. -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_wait(&(*s_queue_signaux).semaphore); # else sem_wait(semaphore_queue_signaux); @@ -125,7 +125,7 @@ thread_surveillance_signaux(void *argume raise(SIGALRM); } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&(*s_queue_signaux).semaphore); # else sem_post(semaphore_queue_signaux); @@ -325,7 +325,7 @@ retrait_thread(struct_processus *s_etat_ (*l_element_courant).donnee)).s_etat_processus) .pointeur_signal_lecture) { -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_wait(&((*s_queue_signaux).signalisation)); # else sem_wait(semaphore_signalisation); @@ -746,6 +746,8 @@ liberation_threads(struct_processus *s_e liberation_arbre_variables(s_etat_processus, (*s_etat_processus).s_arbre_variables, d_faux); +#warning A FIXER + /* for(i = 0; i < (*s_etat_processus).nombre_variables_statiques; i++) { pthread_mutex_trylock(&((*(*s_etat_processus) @@ -759,6 +761,7 @@ liberation_threads(struct_processus *s_e } free((*s_etat_processus).s_liste_variables_statiques); + */ // Ne peut être effacé qu'une seule fois if (suppression_variables_partagees == d_faux) @@ -2397,7 +2400,7 @@ scrutation_interruptions(struct_processu // à lire. Les pointeurs d'écriture pointent sur les prochains éléments à // écrire. -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_trywait(&((*s_queue_signaux).semaphore)) == 0) # else if (sem_trywait(semaphore_queue_signaux) == 0) @@ -2417,14 +2420,14 @@ scrutation_interruptions(struct_processu ((*s_queue_signaux).pointeur_lecture + 1) % LONGUEUR_QUEUE_SIGNAUX; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_wait(&((*s_queue_signaux).signalisation)); # else sem_wait(semaphore_signalisation); # endif } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&((*s_queue_signaux).semaphore)); # else sem_post(semaphore_queue_signaux); @@ -2448,7 +2451,7 @@ scrutation_interruptions(struct_processu ((*s_etat_processus).pointeur_signal_lecture + 1) % LONGUEUR_QUEUE_SIGNAUX; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_wait(&((*s_queue_signaux).signalisation)); # else sem_wait(semaphore_signalisation); @@ -2560,7 +2563,7 @@ envoi_signal_processus(pid_t pid, enum s return(1); } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) while(sem_wait(&((*s_queue_signaux).semaphore)) != 0) # else while(sem_wait(semaphore_queue_signaux) != 0) @@ -2581,7 +2584,7 @@ envoi_signal_processus(pid_t pid, enum s ((*s_queue_signaux).pointeur_ecriture + 1) % LONGUEUR_QUEUE_SIGNAUX; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_post(&((*s_queue_signaux).semaphore)) != 0) # else if (sem_post(semaphore_queue_signaux) != 0) @@ -2590,7 +2593,7 @@ envoi_signal_processus(pid_t pid, enum s return(1); } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_post(&((*s_queue_signaux).signalisation)) != 0) # else if (sem_post(semaphore_signalisation) != 0) @@ -2843,7 +2846,7 @@ envoi_signal_thread(pthread_t tid, enum return(1); } -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_post(&((*s_queue_signaux).signalisation)) != 0) { return(1); @@ -2871,7 +2874,7 @@ envoi_signal_contexte(struct_processus * % LONGUEUR_QUEUE_SIGNAUX; pthread_mutex_unlock(&mutex_interruptions); -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) if (sem_post(&((*s_queue_signaux).signalisation)) != 0) { return(1); @@ -3142,7 +3145,7 @@ liberation_queue_signaux(struct_processu (*s_queue_signaux).requete_arret = d_vrai; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&((*s_queue_signaux).signalisation)); # else sem_post(semaphore_signalisation); @@ -3205,7 +3208,7 @@ destruction_queue_signaux(struct_process (*s_queue_signaux).requete_arret = d_vrai; -# if defined(SEMAPHORES_NOMMES) || defined(IPCS_SYSV) +# if (!defined(SEMAPHORES_NOMMES)) || defined(IPCS_SYSV) sem_post(&((*s_queue_signaux).signalisation)); # else sem_post(semaphore_signalisation);