From 736108d73d221ea1cd914264138fe33699d8d292 Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Tue, 28 May 2024 16:12:58 -0600 Subject: [PATCH] add `LazyLock` to "Higher-level sync" docs --- library/std/src/sync/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs index fb7d601b09478..8d09d11450928 100644 --- a/library/std/src/sync/mod.rs +++ b/library/std/src/sync/mod.rs @@ -125,6 +125,9 @@ //! - [`Condvar`]: Condition Variable, providing the ability to block //! a thread while waiting for an event to occur. //! +//! - [`LazyLock`]: Used for thread-safe, lazy initialization of a +//! global variable (initialization routine provided at declaration). +//! //! - [`mpsc`]: Multi-producer, single-consumer queues, used for //! message-based communication. Can provide a lightweight //! inter-thread synchronisation mechanism, at the cost of some @@ -133,10 +136,10 @@ //! - [`Mutex`]: Mutual Exclusion mechanism, which ensures that at //! most one thread at a time is able to access some data. //! -//! - [`Once`]: Used for a thread-safe, one-time global initialization routine +//! - [`Once`]: Used for a thread-safe, one-time global initialization routine. //! //! - [`OnceLock`]: Used for thread-safe, one-time initialization of a -//! global variable. +//! global variable (initialization routine provided at point of use). //! //! - [`RwLock`]: Provides a mutual exclusion mechanism which allows //! multiple readers at the same time, while allowing only one @@ -149,6 +152,7 @@ //! [`mpsc`]: crate::sync::mpsc //! [`Mutex`]: crate::sync::Mutex //! [`Once`]: crate::sync::Once +//! [`LazyLock`]: crate::sync::LazyLock //! [`OnceLock`]: crate::sync::OnceLock //! [`RwLock`]: crate::sync::RwLock