You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-standard-lazy-types.md
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ The thread-safe variant is implemented similarly to `std::sync::Once`.
249
249
Crucially, it has support for blocking: if many threads call `get_or_init` concurrently, only one will be able to execute the closure, while all other threads will block.
250
250
For this reason, most of `std::sync::OnceCell` API can not be provided in `core`.
251
251
In the `sync` case, reliably panicking on re-entrant initialization is not trivial.
252
-
For this reason, the implementaion would simply deadlock, with a note that a deadlock might be elevated to panic in the future.
252
+
For this reason, the implementation would simply deadlock, with a note that a deadlock might be elevated to a panic in the future.
253
253
254
254
# Drawbacks
255
255
[drawbacks]: #drawbacks
@@ -376,10 +376,14 @@ impl<T> OnceCell<T> {
376
376
}
377
377
```
378
378
379
-
Itispossiblebecause, while `OnceCell` needsblockforfullAPI, itsinternalstatecanbeimplementedasasingle `AtomicUsize`, sothe `core` partdoesnotneedtoknowaboutblocking.
379
+
Itispossiblebecause, while `OnceCell` needsblockingforfullAPI, itsinternalstatecanbeimplementedasasingle `AtomicUsize`, sothe `core` partdoesnotneedtoknowaboutblocking.
0 commit comments