@@ -20,6 +20,8 @@ union Data<T, F> {
20
20
/// A value which is initialized on the first access.
21
21
///
22
22
/// This type is a thread-safe [`LazyCell`], and can be used in statics.
23
+ /// Therefore, any dereferencing call will block the calling thread if
24
+ /// another initialization routine is currently running.
23
25
///
24
26
/// [`LazyCell`]: crate::cell::LazyCell
25
27
///
@@ -81,8 +83,7 @@ pub struct LazyLock<T, F = fn() -> T> {
81
83
}
82
84
83
85
impl < T , F : FnOnce ( ) -> T > LazyLock < T , F > {
84
- /// Creates a new lazy value with the given initializing
85
- /// function.
86
+ /// Creates a new lazy value with the given initializing function.
86
87
#[ inline]
87
88
#[ unstable( feature = "lazy_cell" , issue = "109736" ) ]
88
89
pub const fn new ( f : F ) -> LazyLock < T , F > {
@@ -239,7 +240,7 @@ impl<T: fmt::Debug, F> fmt::Debug for LazyLock<T, F> {
239
240
}
240
241
241
242
// We never create a `&F` from a `&LazyLock<T, F>` so it is fine
242
- // to not impl `Sync` for `F`
243
+ // to not impl `Sync` for `F`.
243
244
#[ unstable( feature = "lazy_cell" , issue = "109736" ) ]
244
245
unsafe impl < T : Sync + Send , F : Send > Sync for LazyLock < T , F > { }
245
246
// auto-derived `Send` impl is OK.
0 commit comments