version 1.13, 2010/08/06 15:32:58
|
version 1.15, 2010/08/10 18:02:43
|
Line 40
|
Line 40
|
void * |
void * |
fusible(void *argument) |
fusible(void *argument) |
{ |
{ |
|
# ifndef OS2 |
|
|
real8 temps_cpu_precedent; |
real8 temps_cpu_precedent; |
real8 temps_cpu_courant; |
real8 temps_cpu_courant; |
|
|
Line 85 fusible(void *argument)
|
Line 87 fusible(void *argument)
|
temporisation.tv_sec = 0; |
temporisation.tv_sec = 0; |
temporisation.tv_nsec = 100000000; // un dixième de seconde |
temporisation.tv_nsec = 100000000; // un dixième de seconde |
|
|
# ifndef OS2 |
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); |
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); |
# endif |
|
|
|
getrusage(RUSAGE_SELF, &s_rusage); |
getrusage(RUSAGE_SELF, &s_rusage); |
temps_cpu_courant = s_rusage.ru_utime.tv_sec + |
temps_cpu_courant = s_rusage.ru_utime.tv_sec + |
Line 97 fusible(void *argument)
|
Line 97 fusible(void *argument)
|
{ |
{ |
pthread_testcancel(); |
pthread_testcancel(); |
nanosleep(&temporisation, NULL); |
nanosleep(&temporisation, NULL); |
|
|
getrusage(RUSAGE_SELF, &s_rusage); |
getrusage(RUSAGE_SELF, &s_rusage); |
|
|
temps_cpu_precedent = temps_cpu_courant; |
temps_cpu_precedent = temps_cpu_courant; |
Line 134 fusible(void *argument)
|
Line 133 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("+++Attention : Function unavailable\n"); |
|
} |
|
# endif |
|
|
pthread_exit(NULL); |
pthread_exit(NULL); |
} |
} |
|
|