From 8161d179ae1f27929890a8d6bd9bd1442a1589c3 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Thu, 18 Apr 2024 09:35:46 +0200 Subject: [PATCH] sync: document that `Barrier::wait` is not cancel safe Signed-off-by: Alice Ryhl --- tokio/src/sync/barrier.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tokio/src/sync/barrier.rs b/tokio/src/sync/barrier.rs index a1f87c44a3d..aa2f9e0cf75 100644 --- a/tokio/src/sync/barrier.rs +++ b/tokio/src/sync/barrier.rs @@ -118,6 +118,10 @@ impl Barrier { /// A single (arbitrary) future will receive a [`BarrierWaitResult`] that returns `true` from /// [`BarrierWaitResult::is_leader`] when returning from this function, and all other tasks /// will receive a result that will return `false` from `is_leader`. + /// + /// # Cancel safety + /// + /// This method is not cancel safe. pub async fn wait(&self) -> BarrierWaitResult { #[cfg(all(tokio_unstable, feature = "tracing"))] return trace::async_op(