/demos/trunk/tracer/small/treef1.c |
---|
18,6 → 18,7 |
#include <stdlib.h> |
#include <semaphore.h> |
#include <stdio.h> |
#include <time.h> |
#include "common.h" |
47,8 → 48,11 |
sem_wait(&actmutex); |
if (actcounter>=MPROC) { |
struct timespec delay; |
delay.tv_sec = 0; |
delay.tv_nsec = 10000000; |
sem_signal(&actmutex); |
task_delay(10000); |
nanosleep(&delay, NULL); |
goto REPEAT; |
} |
200,11 → 204,16 |
activate_task(-1,FROMDIR); |
for(;;) { |
sem_wait(&actmutex); |
if (actcounter==0) break; |
sem_signal(&actmutex); |
task_delay(500000); |
{ |
struct timespec delay; |
delay.tv_sec = 0; |
delay.tv_nsec = 500000000; |
for(;;) { |
sem_wait(&actmutex); |
if (actcounter==0) break; |
sem_signal(&actmutex); |
nanosleep(&delay, NULL); |
} |
} |
cprintf("\nfiles: %i\n",filecounter); |