From 4cabddccc75acd4935f3fbfb706594c3bfed1571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sat, 4 Nov 2023 23:36:12 +1300 Subject: [PATCH] Clarify cancel safety --- src/tokio/child.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tokio/child.rs b/src/tokio/child.rs index 2693189..31c269f 100644 --- a/src/tokio/child.rs +++ b/src/tokio/child.rs @@ -207,8 +207,12 @@ impl AsyncGroupChild { /// /// See [the Tokio documentation](Child::wait) for more. /// - /// The current implementation spawns a blocking task on the Tokio thread pool **and is not - /// cancel-safe** (you shouldn't call it twice); contributions are welcome for a better version. + /// The current implementation spawns a blocking task on the Tokio thread pool; contributions + /// are welcome for a better version. Additionally, there is no way to cancel the underlying + /// wait() call, so cancelling this future will not cancel the wait. A waited process that exits + /// will have its resources cleaned up by the kernel: if the application is no longer listening + /// for the underlying wait(), it will not know that the process has exited and will try to wait + /// on it again, which may fail, or could even attach to the recycled PID (of another process). /// /// # Examples ///