I use some global variables, only Integer, which can be accessed from several threads. Under normal circumstances only one thread writes this variable but other threads read them.
var xxx: Integer = 0
What must be done to make this variable thread-safe for Swift 6?
Can somebody give me a simple example, how to handle my few global variables. The variables are currently not part of a class/struct. Only simple variables.
1