Skip to content

Commit 7060a2f

Browse files
authored
Rollup merge of rust-lang#128457 - juntyr:once-lock-docs, r=tgross35
Fix docs for OnceLock::get_mut_or_init Removes an incorrect statment about concurrency from the `OnceLock::get_mut_or_init` (tracked in rust-lang#121641) docs. Fixes rust-lang#128429
2 parents b22c48e + 83fb140 commit 7060a2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/sync/once_lock.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ impl<T> OnceLock<T> {
281281
/// Gets the mutable reference of the contents of the cell, initializing
282282
/// it with `f` if the cell was empty.
283283
///
284-
/// Many threads may call `get_mut_or_init` concurrently with different
285-
/// initializing functions, but it is guaranteed that only one function
286-
/// will be executed.
284+
/// This method never blocks.
287285
///
288286
/// # Panics
289287
///
@@ -373,6 +371,8 @@ impl<T> OnceLock<T> {
373371
/// it with `f` if the cell was empty. If the cell was empty and `f` failed,
374372
/// an error is returned.
375373
///
374+
/// This method never blocks.
375+
///
376376
/// # Panics
377377
///
378378
/// If `f` panics, the panic is propagated to the caller, and

0 commit comments

Comments
 (0)