| 78 | } |
| 79 | |
| 80 | static inline struct thread *get_free_thread(void) |
| 81 | { |
| 82 | struct thread *t; |
| 83 | |
| 84 | t = pop_thread(&free_threads); |
| 85 | if (t == NULL) |
| 86 | return NULL; |
| 87 | |
| 88 | /* Reset the current stack value to the original. */ |
| 89 | if (!t->stack_orig) |
| 90 | die("%s: Invalid stack value\n", __func__); |
| 91 | |
| 92 | t->stack_current = t->stack_orig; |
| 93 | |
| 94 | return t; |
| 95 | } |
| 96 | |
| 97 | static inline void free_thread(struct thread *t) |
| 98 | { |
no test coverage detected