From 3eda51a7a5cda1c6cc0ae6f357827f7eaa1b222d Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 5 Nov 2024 11:19:27 -0500 Subject: [PATCH] docs: clarify documentation of sync module Based on feedback from customers, adding a clearer and top-line comment about runtime-agnosticism for the sync module. --- tokio/src/sync/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index ddf99644270..881b66bbaef 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -9,6 +9,13 @@ //! //! [tasks]: crate::task //! +//! **Note**: All functionality provided in this module is runtime agnostic. It is safe +//! and correct to use these primitives without also using Tokio. Some types may provide additional +//! functionality when used with Tokio runtime (e.g. cooperation with [Task Dumps]), but all +//! documented functionality is runtime-agnostic. +//! +//! [Task Dumps]: crate::runtime::Handle::dump +//! //! # Message passing //! //! The most common form of synchronization in a Tokio program is message