Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7e47256

Browse files
committedJun 3, 2024
Differ LazyLock vs. OnceLock in std::sync overview
1 parent a198721 commit 7e47256

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎std/src/sync/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@
136136
//! - [`Once`]: Used for a thread-safe, one-time global initialization routine
137137
//!
138138
//! - [`OnceLock`]: Used for thread-safe, one-time initialization of a
139-
//! global variable.
139+
//! variable, with potentially different initializers based on the caller.
140+
//!
141+
//! - [`LazyLock`]: Used for thread-safe, one-time initialization of a
142+
//! variable, using one nullary initializer function provided at creation.
140143
//!
141144
//! - [`RwLock`]: Provides a mutual exclusion mechanism which allows
142145
//! multiple readers at the same time, while allowing only one

0 commit comments

Comments
 (0)
Failed to load comments.