--- rpl/src/rpl.h 2012/06/21 16:07:25 1.169 +++ rpl/src/rpl.h 2012/09/15 12:57:09 1.175 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.9 + RPL/2 (R) version 4.1.10 Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -145,9 +145,10 @@ int sem_close_SysV(sem_t *sem); int sem_wait_SysV(sem_t *sem); int sem_trywait_SysV(sem_t *sem); + int sem_timedwait_SysV(sem_t *sem, struct timespec *ts); int sem_post_SysV(sem_t *sem); int sem_getvalue_SysV(sem_t *sem, int *value); - int sem_unlink_SysV(const char *nom); + int sem_unlink_SysV(char *nom); int sem_destroy_SysV(sem_t *sem); # endif @@ -342,6 +343,7 @@ union semun # define sem_destroy(a) sem_destroy_SysV(a) # define sem_wait(a) sem_wait_SysV(a) # define sem_trywait(a) sem_trywait_SysV(a) +# define sem_timedwait(a, b) sem_timedwait_SysV(a, b) # define sem_post(a) sem_post_SysV(a) # define sem_getvalue(a, b) sem_getvalue_SysV(a, b) # define sem_open(...) sem_open_SysV(__VA_ARGS__) @@ -367,7 +369,7 @@ union semun // SIGHUP // SIGALRM -# define SIGTEST SIGUSR1 +# define SIGTEST 255 // Nombre d'interruptions disponibles # define d_NOMBRE_INTERRUPTIONS 64 @@ -431,7 +433,7 @@ union semun __EXTERN__ jmp_buf contexte_processus; __EXTERN__ jmp_buf contexte_thread; - __EXTERN__ int signal_test; + __EXTERN__ volatile int signal_test; __EXTERN__ pid_t pid_processus_pere; @@ -443,6 +445,7 @@ union semun __STATIC_MUTEX_INITIALIZATION__; __EXTERN__ pthread_mutex_t mutex_gestionnaires_signaux_atomique __STATIC_MUTEX_INITIALIZATION__; + __EXTERN__ pthread_mutex_t mutex_sections_critiques; __EXTERN__ sem_t __PTR__ semaphore_gestionnaires_signaux; @@ -1479,12 +1482,13 @@ typedef struct liste_pile_systeme /* type clôture : - C SELECT : END termine un test SELECT/DEFAULT/END. - D DO : END termine une boucle DO/UNTIL/END. - I IF : END termine un test IF/THEN (ELSE)/END. - J IFERR : END termine un test IFERR/THEN (ELSE)/END. - K CASE : END termine un test CASE/THEN/END - W WHILE : END termine une boucle WHILE/REPEAT/END. + C SELECT : END termine un test SELECT/DEFAULT/END. + D DO : END termine une boucle DO/UNTIL/END. + I IF : END termine un test IF/THEN (ELSE)/END. + J IFERR : END termine un test IFERR/THEN (ELSE)/END. + K CASE : END termine un test CASE/THEN/END + W WHILE : END termine une boucle WHILE/REPEAT/END. + Q CRITICAL : END termine une section critique CRITICAL/END F FOR : NEXT ou STEP termine une boucle avec compteur. S START : NEXT ou STEP termine une boucle sans compteur. @@ -2213,6 +2217,7 @@ typedef struct processus struct_liste_chainee *liste_mutexes; pthread_mutex_t protection_liste_mutexes; + unsigned int sections_critiques; /* Drapeau nécessaire à RESTART */ @@ -2385,6 +2390,7 @@ void instruction_cosh(struct_processus * void instruction_cov(struct_processus *s_etat_processus); void instruction_cr(struct_processus *s_etat_processus); void instruction_create(struct_processus *s_etat_processus); +void instruction_critical(struct_processus *s_etat_processus); void instruction_crmtx(struct_processus *s_etat_processus); void instruction_cross(struct_processus *s_etat_processus); void instruction_crsmphr(struct_processus *s_etat_processus);