diff options
Diffstat (limited to 'include/libtf/scheduler.h')
-rw-r--r-- | include/libtf/scheduler.h | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/include/libtf/scheduler.h b/include/libtf/scheduler.h deleted file mode 100644 index db5a823..0000000 --- a/include/libtf/scheduler.h +++ /dev/null @@ -1,67 +0,0 @@ -/* scheduler.h - libtf fiber scheduler header - * - * Copyright (C) 2009-2010 Timo Teräs <timo.teras@iki.fi> - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 or later as - * published by the Free Software Foundation. - * - * See http://www.gnu.org/ for details. - */ - -#ifndef TF_SCHEDULER_H -#define TF_SCHEDULER_H - -#include <libtf/atomic.h> -#include <libtf/list.h> -#include <libtf/heap.h> -#include <libtf/fiber.h> - -struct tf_poll_hooks; - -struct tf_scheduler { - struct tf_list_head scheduled_q; - struct tf_list_head running_q; - struct tf_heap_head heap; - void * active_fiber; - void * main_fiber; - int num_fibers; - tf_mtime_t scheduler_time; - struct tf_poll_hooks * poller; - unsigned long poll_data[2]; -}; - -static inline -struct tf_scheduler *tf_scheduler_get_current(void) -{ - extern struct tf_scheduler *__tf_scheduler; - TF_BUG_ON(__tf_scheduler == NULL); - return __tf_scheduler; -} - -static inline -tf_mtime_t tf_scheduler_get_mtime(void) -{ - return tf_scheduler_get_current()->scheduler_time; -} - -struct tf_scheduler *tf_scheduler_create(void); -int tf_scheduler_enable(struct tf_scheduler *); -void tf_scheduler_disable(void); - -static inline struct tf_scheduler * -tf_scheduler_get(struct tf_scheduler *s) -{ - tf_fiber_get(s); - return s; -} - -static inline void -tf_scheduler_put(struct tf_scheduler *s) -{ - tf_fiber_put(s); -} - -#endif - |