From e6bea65b6e53e7e283d30e1437da827c6325c589 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 17 Feb 2021 14:01:58 -0800 Subject: rototiller: add rototiller_quiesce() This is a wrapper around threads_wait_idle(), so the caller can easily synchronize with outstanding work before tearing things down or otherwise rejiggering the world. --- src/rototiller.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/rototiller.c') diff --git a/src/rototiller.c b/src/rototiller.c index 18f0376..2a3d45c 100644 --- a/src/rototiller.c +++ b/src/rototiller.c @@ -75,6 +75,13 @@ int rototiller_init(void) } +/* wait for all threads to be idle */ +void rototiller_quiesce(void) +{ + threads_wait_idle(rototiller_threads); +} + + void rototiller_shutdown(void) { threads_destroy(rototiller_threads); -- cgit v1.2.1