| 231 | } |
| 232 | |
| 233 | error_t thread_join(Thread* thread, TickType_t timeout, TickType_t poll_interval) { |
| 234 | check(thread_get_current() != thread); |
| 235 | |
| 236 | TickType_t start_ticks = get_ticks(); |
| 237 | while (thread_get_task_handle(thread)) { |
| 238 | delay_ticks(poll_interval); |
| 239 | if (get_ticks() - start_ticks > timeout) { |
| 240 | return ERROR_TIMEOUT; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | return ERROR_NONE; |
| 245 | } |
| 246 | |
| 247 | TaskHandle_t thread_get_task_handle(Thread* thread) { |
| 248 | thread->lock(); |
no test coverage detected