SE-0302: ConcurrentValue and @concurrent closures

About the thread-safety of value types, I wrote some rules-of-thumb here: Understanding Swift's value type thread safety - #14 by JJJ

Basically lets are thread-safe, vars are not. If you start a closure by assigning a shared var to a local let your closure still access a non-local var and is therefore not thread-safe. If you capture the shared var as a let up front, then all is good :smiley: :+1:

2 Likes