var myAtomic = Atomic<Int>(5)
myAtomic.synced { $0 = 2 }
print( myAtomic.value )
// Prints "2"
Atomic is a generic wrapper-struct for values that need to be accessible safely, when working concurrently.
When accessing the value a NSLock will be locked, after accessing it will be unlocked.
"sync(_: f: @noescape(inout T) throws -> ()) rethrows" can be used to lock the value while running a block possibly changing the value.