]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - src_aquosa/fosa_time.c
Bugfixes and restyling.
[frescor/fosa.git] / src_aquosa / fosa_time.c
index fdbf95e17f5b2d2c204156ec6c80700c7d9ddad5..571ccce8ce787512ab4d7a4aecbb11f21b8e08a0 100644 (file)
@@ -64,6 +64,7 @@
 //================================================
 
 #include "fosa_time.h"
+#include "fosa_clocks_and_timers.h"
 #include "fosa_threads_and_signals.h"
 
 /**
@@ -79,11 +80,8 @@ void inline fosa_eat(const struct timespec *cpu_time)
        struct timespec current_time, time_to_go;
 
        self = fosa_thread_self();
-       if (self.linux_pid == self.linux_tid)
-               error = clock_getcpuclockid(self.linux_pid, &clock_id);
-       else
-               error = pthread_getcpuclockid(self.pthread_id, &clock_id);
-       if (error != 0)
+       error = fosa_thread_get_cputime_clock(self, &clock_id);
+       if (!error)
                return;
 
        if (clock_gettime(clock_id, &current_time) != 0)