Read Introducing Swift Atomics.