From d8dee34c6f46d2bc0deda626ec5c14cf46f5ce03 Mon Sep 17 00:00:00 2001 From: Jonas Fassbender Date: Tue, 10 Sep 2024 08:09:08 +0200 Subject: [PATCH] Enhanced wording for coop paragraph in runtime compatiblity section Co-authored-by: Alice Ryhl --- tokio/src/sync/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index 5d7942ffa7f..7158e993531 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -439,11 +439,8 @@ //! or even use them from non-Tokio runtimes. //! //! When used in a Tokio runtime, the synchronization primitives participate in -//! [cooperative scheduling](crate::task#cooperative-scheduling), -//! periodically yielding back control to the runtime to avoid starving it. -//! In a non-Tokio runtime, the yield points where control is handed back do -//! nothing, not changing the behavior of the synchronization primitive in any -//! way. +//! [cooperative scheduling](crate::task#cooperative-scheduling) to avoid +//! starvation. This feature does not apply when used from non-Tokio runtimes. //! //! The only exception to runtime compatibility is the //! [`mpsc::Sender::send_timeout`] method, which can't be called from non-Tokio