| 1 | /* @title: Thread reaper */ |
|---|---|
| 2 | #pragma once |
| 3 | #include <structures/locked_list.h> |
| 4 | #include <sync/condvar.h> |
| 5 | #include <sync/semaphore.h> |
| 6 | #include <sync/spinlock.h> |
| 7 | #include <thread/queue.h> |
| 8 | #include <thread/thread.h> |
| 9 | |
| 10 | struct reaper_thread { |
| 11 | struct locked_list list; |
| 12 | struct semaphore sem; |
| 13 | struct thread *thread; |
| 14 | }; |
| 15 | |
| 16 | void reaper_enqueue(struct thread *t); |
| 17 | void reaper_thread_main(void *nothing); |
| 18 | void reaper_init(void); |
| 19 | uint64_t reaper_get_reaped_thread_count(void); |
| 20 |