X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=sched.c;h=1db9169b38b511918cc711fc28dcb667e1242e5f;hp=f355c9750bc3ee2c426b2b5505073813973ce3cb;hb=7c007561e7031f5e33b91a8baf51bb952693a2d0;hpb=879e52d49df6d00aa9eafe5cccb48bbd24ed4c81 diff --git a/sched.c b/sched.c index f355c975..1db9169b 100644 --- a/sched.c +++ b/sched.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2014 Andre Noll + * Copyright (C) 2006 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -7,7 +7,6 @@ /** \file sched.c Paraslash's scheduling functions. */ #include -#include #include "para.h" #include "ipc.h" @@ -49,13 +48,7 @@ struct task { }; static struct timeval now_struct; -struct timeval *now = &now_struct; - -static inline bool timeout_is_zero(struct sched *s) -{ - struct timeval *tv = &s->select_timeout; - return tv->tv_sec == 0 && tv->tv_usec == 0; -} +const struct timeval *now = &now_struct; static void sched_preselect(struct sched *s) { @@ -147,7 +140,7 @@ again: FD_ZERO(&s->wfds); s->select_timeout = s->default_timeout; s->max_fileno = -1; - clock_get_realtime(now); + clock_get_realtime(&now_struct); sched_preselect(s); ret = s->select_function(s->max_fileno + 1, &s->rfds, &s->wfds, &s->select_timeout); @@ -163,7 +156,7 @@ again: FD_ZERO(&s->rfds); FD_ZERO(&s->wfds); } - clock_get_realtime(now); + clock_get_realtime(&now_struct); num_running_tasks = sched_post_select(s); if (num_running_tasks == 0) return 0;