Global and static variables in Swift are conceptually similar to those in C++, and used for much the same purpose. However, Swift takes the "Initialize on First Use" principle all the way, with all global and static variables being initialized on first use. Function-local statics in Swift work identically to those in C++, based on the same "Initialize on First Use" principle.
I thought they did not exist in Swift, but I tried it anyway:
func f () {
static var u: Int = 7
// error: Static properties may only be declared on a type
}
That would trigger an error for a local variable and should do the same with a function-static one. I think it should be safe to treat func-statics the same way as locals in terms of concurrency safety.