diff options
| author | Jubilee Young <workingjubilee@gmail.com> | 2024-05-27 10:24:28 -0700 |
|---|---|---|
| committer | Jubilee Young <workingjubilee@gmail.com> | 2024-06-02 22:53:41 -0700 |
| commit | fdb96f2123a8306e24f6ef0c77296bf0d2f9af99 (patch) | |
| tree | 6b25b8e2b09ee33e68bb23d5525738b7af1ca932 | |
| parent | 940594ff1842026cf16efb0af5210de6966fbfdb (diff) | |
| download | rust-fdb96f2123a8306e24f6ef0c77296bf0d2f9af99.tar.gz rust-fdb96f2123a8306e24f6ef0c77296bf0d2f9af99.zip | |
Differ LazyLock vs. OnceLock in std::sync overview
| -rw-r--r-- | library/std/src/sync/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
