Import std.concurrent.lazy
std.concurrent.lazy
Lazy<T>: a value made the first time a thread asks for it, by the Sendable Func it was given,
once however many threads ask at once: the others wait while it's made, and each gets the same
value. It's a Shared Class, so a Const or a parameter shares one with the work that Spawn and
Thread.Start run.
std/concurrent/lazy.fb
Types
Lazy
class
Public Shared Class Lazy<T: Sendable>
A value made the first time a thread asks for it, once however many threads ask at once.
std/concurrent/lazy.fb, line 13
-
A Lazy whose value
makermakes, the first time Value is read. -
The value, which the first read makes, on the thread that reads it, while the reads on other threads wait for it. Panics when the maker reads its own Lazy's Value, which would wait for itself forever.
-
Whether the value is made, which a thread that reads it while it's being made doesn't wait for.
Report an issue with this page or with FutureBlitz on GitHub.