From fdb96f2123a8306e24f6ef0c77296bf0d2f9af99 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Mon, 27 May 2024 10:24:28 -0700 Subject: Differ LazyLock vs. OnceLock in std::sync overview --- library/std/src/sync/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'library/std/src') diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index fb7d601b094..70e8f5f90c6 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -136,7 +136,10 @@ //! - [`Once`]: Used for a thread-safe, one-time global initialization routine //! //! - [`OnceLock`]: Used for thread-safe, one-time initialization of a -//! global variable. +//! variable, with potentially different initializers based on the caller. +//! +//! - [`LazyLock`]: Used for thread-safe, one-time initialization of a +//! variable, using one nullary initializer function provided at creation. //! //! - [`RwLock`]: Provides a mutual exclusion mechanism which allows //! multiple readers at the same time, while allowing only one -- cgit 1.4.1-3-g733a5