Prepare a thread so that it starts by executing thread_entry(thread_arg). * Within thread_entry() it will call func(arg). */
| 174 | /* Prepare a thread so that it starts by executing thread_entry(thread_arg). |
| 175 | * Within thread_entry() it will call func(arg). */ |
| 176 | static void prepare_thread(struct thread *t, struct thread_handle *handle, |
| 177 | enum cb_err (*func)(void *), void *arg, |
| 178 | asmlinkage void (*thread_entry)(void *), void *thread_arg) |
| 179 | { |
| 180 | /* Stash the function and argument to run. */ |
| 181 | t->entry = func; |
| 182 | t->entry_arg = arg; |
| 183 | |
| 184 | /* All new threads can yield by default. */ |
| 185 | t->can_yield = 1; |
| 186 | |
| 187 | /* Pointer used to publish the state of thread */ |
| 188 | t->handle = handle; |
| 189 | |
| 190 | arch_prepare_thread(t, thread_entry, thread_arg); |
| 191 | } |
| 192 | |
| 193 | static void thread_resume_from_timeout(struct timeout_callback *tocb) |
| 194 | { |
no test coverage detected