Diff for /rpl/src/fusible.c between versions 1.35 and 1.36

version 1.35, 2011/10/10 16:39:00 version 1.36, 2011/10/14 08:13:05
Line 47  fusible(void *argument) Line 47  fusible(void *argument)
   
     struct_processus        *s_etat_processus;      struct_processus        *s_etat_processus;
   
   #   ifndef OS2
     struct rusage           s_rusage;      struct rusage           s_rusage;
   #   else
       clock_t                 horloge;
   #   endif
   
     struct timespec         temporisation;      struct timespec         temporisation;
   
Line 81  fusible(void *argument) Line 85  fusible(void *argument)
     pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);      pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
 #   endif  #   endif
   
     getrusage(RUSAGE_SELF, &s_rusage);  #   ifndef OS2
     temps_cpu_courant = s_rusage.ru_utime.tv_sec +          getrusage(RUSAGE_SELF, &s_rusage);
             (((real8) s_rusage.ru_utime.tv_usec) / ((real8) 1E6));          temps_cpu_courant = s_rusage.ru_utime.tv_sec +
                   (((real8) s_rusage.ru_utime.tv_usec) / ((real8) 1E6));
   #   else
           horloge = clock();
           temps_cpu_courant = horloge / CLOCKS_PER_SEC;
   #   endif
   
     do      do
     {      {
         pthread_testcancel();          pthread_testcancel();
         nanosleep(&temporisation, NULL);          nanosleep(&temporisation, NULL);
         getrusage(RUSAGE_SELF, &s_rusage);  
   
         temps_cpu_precedent = temps_cpu_courant;          temps_cpu_precedent = temps_cpu_courant;
         temps_cpu_courant = s_rusage.ru_utime.tv_sec +  
                 (((real8) s_rusage.ru_utime.tv_usec) / ((real8) 1E6));  #       ifndef OS2
               getrusage(RUSAGE_SELF, &s_rusage);
               temps_cpu_courant = s_rusage.ru_utime.tv_sec +
                       (((real8) s_rusage.ru_utime.tv_usec) / ((real8) 1E6));
   #       else
               horloge = clock();
               temps_cpu_courant = horloge / CLOCKS_PER_SEC;
   
               if (temps_cpu_courant < temps_cpu_precedent)
               {
                   // Le compteur a fait un tour...
                   temps_cpu_precedent = temps_cpu_courant;
               }
   #       endif
   
         (*s_etat_processus).temps_maximal_cpu -= temps_cpu_courant -          (*s_etat_processus).temps_maximal_cpu -= temps_cpu_courant -
                 temps_cpu_precedent;                  temps_cpu_precedent;
Line 125  fusible(void *argument) Line 145  fusible(void *argument)
         fflush(stdout);          fflush(stdout);
     }      }
   
 #   else  
   
     struct_processus        *s_etat_processus;  
   
     s_etat_processus = argument;  
   
     if ((*s_etat_processus).langue == 'F')  
     {  
         printf("+++Attention : Support indisponible sous OS/2\n");  
     }  
     else  
     {  
         printf("+++Warning : Function unavailable\n");  
     }  
 #   endif  
   
     pthread_exit(NULL);      pthread_exit(NULL);
 }  }
   

Removed from v.1.35  
changed lines
  Added in v.1.36


CVSweb interface <joel.bertrand@systella.fr>