Skip to content

Commit

Permalink
Document the safety properties of lazy"str"
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Apr 11, 2022
1 parent 261c63b commit 4b7b1fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions base/strings/lazy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ LazyString
!!! compat "Julia 1.8"
`lazy"str"` requires Julia 1.8 or later.
# Extended help
## Safety properties for concurrent programs
A lazy string itself does not introduce any concurrency problems even if it is printed in
multiple Julia tasks. However, if `print` methods on a captured value can have a
concurrency issue when invoked without synchronizations, printing the lazy string may cause
an issue. Furthermore, the `print` methods on the captured values may be invoked multiple
times.
"""
macro lazy_str(text)
parts = Any[]
Expand Down

0 comments on commit 4b7b1fd

Please sign in to comment.