Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e47256

Browse files
Differ LazyLock vs. OnceLock in std::sync overview
1 parenta198721 commit7e47256

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎std/src/sync/mod.rs‎

Lines changed: 4 additions & 1 deletion
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)

[8]ページ先頭

©2009-2025 Movatter.jp