| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | /* |
| 3 | * Copyright (C) 2020-2021 Paul Cercueil <paul@crapouillou.net> |
| 4 | */ |
| 5 | |
| 6 | #ifndef __LIGHTREC_REAPER_H__ |
| 7 | #define __LIGHTREC_REAPER_H__ |
| 8 | |
| 9 | struct lightrec_state; |
| 10 | struct reaper; |
| 11 | |
| 12 | typedef void (*reap_func_t)(struct lightrec_state *state, void *); |
| 13 | |
| 14 | struct reaper *lightrec_reaper_init(struct lightrec_state *state); |
| 15 | void lightrec_reaper_destroy(struct reaper *reaper); |
| 16 | |
| 17 | int lightrec_reaper_add(struct reaper *reaper, reap_func_t f, void *data); |
| 18 | void lightrec_reaper_reap(struct reaper *reaper); |
| 19 | |
| 20 | void lightrec_reaper_pause(struct reaper *reaper); |
| 21 | void lightrec_reaper_continue(struct reaper *reaper); |
| 22 | |
| 23 | #endif /* __LIGHTREC_REAPER_H__ */ |