JuliaLang/julia

add `Threads.@once`

Open

#51,716 opened on Oct 15, 2023

View on GitHub
 (9 comments) (1 reaction) (0 assignees)Julia (5,773 forks)batch import
good first issuemultithreading

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (Avg merge 20d 6h) (157 merged PRs in 30d)

Description

It might be useful to have a Threads.@once macro that guarantees a line of code will only be executed once, either globally or in a given scope, a la C++ call_once or GCD dispatch_once

Contributor guide