Locks, Thread Safety, and Swift

Mike Ash: Swift requires variables to be initialized before they’re used. pthread_mutex_init doesn’t use the value of the variable passed in, it just overwrites it, but Swift doesn’t know that and so it produces an error. To satisfy the compiler, the variable needs to be initialized with something, but that’s harder than it looks.[…]Getting data … Continue reading Locks, Thread Safety, and Swift