--- rpl/src/rpl.h 2014/07/15 14:12:38 1.246 +++ rpl/src/rpl.h 2014/08/04 06:58:48 1.250 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.1.18 + RPL/2 (R) version 4.1.19 Copyright (C) 1989-2014 Dr. BERTRAND Joël This file is part of RPL/2. @@ -378,24 +378,26 @@ union semun #ifdef IPCS_SYSV # ifdef DEBUG_SEMAPHORES -# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "waiting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 1) BUG(1, uprintf("Value %d\n", value)); \ - sem_wait_SysV(a); }) +# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "waiting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) i\ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 1) BUG(1, uprintf("Value %d\n", value)); \ + sem_wait_SysV(a); }) # define sem_post(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "posting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 0) BUG(1, uprintf("Value %d\n", value)); \ - sem_post_SysV(a); }) + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "posting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_post_SysV(a); }) # define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ - if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ - sem_destroy_SysV(a); }) -#else + if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_destroy_SysV(a); }) +# else # define sem_destroy(a) sem_destroy_SysV(a) # define sem_wait(a) sem_wait_SysV(a) # define sem_post(a) sem_post_SysV(a) @@ -409,21 +411,25 @@ union semun # define sem_close(a) sem_close_SysV(a) # define sem_unlink(a) sem_unlink_SysV(a) #else -# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "waiting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 1) BUG(1, uprintf("Value %d\n", value)); sem_wait(a); }) -# define sem_post(a) ({ int value; sem_getvalue(a, &value); \ - uprintf("[%d-%llu] Semaphore %s (%p) "\ - "posting at %s() " \ - "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \ - #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ - if (value > 0) BUG(1, uprintf("Value %d\n", value)); sem_post(a); }) -# define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ - if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ - sem_destroy(a); }) +# ifdef DEBUG_SEMAPHORES +# define sem_wait(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "waiting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 1) BUG(1, uprintf("Value %d\n", value)); sem_wait(a); }) +# define sem_post(a) ({ int value; sem_getvalue(a, &value); \ + uprintf("[%d-%llu] Semaphore %s (%p) "\ + "posting at %s() " \ + "line #%d\n", (int) getpid(), (unsigned long long) \ + pthread_self(), \ + #a, a, __FUNCTION__, __LINE__), fflush(stdout); \ + if (value > 0) BUG(1, uprintf("Value %d\n", value)); sem_post(a); }) +# define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \ + if (value == 0) BUG(1, uprintf("Value %d\n", value)); \ + sem_destroy(a); }) +# endif #endif @@ -2310,6 +2316,8 @@ typedef struct processus logical1 processus_detache; + enum t_type type_en_cours; + /* Profilage */ logical1 profilage; @@ -3330,6 +3338,8 @@ logical1 initialisation_fichier_acces_in sqlite3 *sqlite, integer8 position_clef, logical1 binaire); logical1 lancement_thread_signaux(struct_processus *s_etat_processus); logical1 recherche_instruction_suivante(struct_processus *s_etat_processus); +logical1 recherche_instruction_suivante_recursive( + struct_processus *s_etat_processus, integer8 recursivite); logical1 retrait_variable(struct_processus *s_etat_processus, unsigned char *nom_variable, unsigned char type); logical1 retrait_variables_par_niveau(struct_processus *s_etat_processus);