2 * @brief Thread scheduler.
9 #include "modeltypes.h"
11 /* Forward declaration */
15 typedef enum enabled_type {
21 void enabled_type_to_string(enabled_type_t e, char *str);
23 /** @brief The Scheduler class performs the mechanics of Thread execution
28 void add_thread(Thread *t);
29 void remove_thread(Thread *t);
30 void sleep(Thread *t);
32 Thread * select_next_thread();
33 void set_current_thread(Thread *t);
34 Thread * get_current_thread() const;
36 enabled_type_t * get_enabled_array() const { return enabled; };
37 void remove_sleep(Thread *t);
38 void add_sleep(Thread *t);
39 enabled_type_t get_enabled(const Thread *t) const;
40 void update_sleep_set(Node *n);
41 bool is_enabled(const Thread *t) const;
42 bool is_enabled(thread_id_t tid) const;
43 bool is_sleep_set(const Thread *t) const;
44 bool all_threads_sleeping() const;
45 void set_scheduler_thread(thread_id_t tid);
49 /** The list of available Threads that are not currently running */
50 enabled_type_t *enabled;
52 int curr_thread_index;
53 void set_enabled(Thread *t, enabled_type_t enabled_status);
55 /** The currently-running Thread */
59 #endif /* __SCHEDULE_H__ */