Spot the bug in Atomic increment

from Property wrappers
Swift 6.3.3 intermediate 4 min 1 issue to find

Find why this wrapper does not make increment() atomic.

swift
@propertyWrapper
final class Atomic<Value> {
    private var value: Value
    private let lock = NSLock()

    var wrappedValue: Value {
        get { lock.withLock { value } }
        set { lock.withLock { value = newValue } }
    }

    init(wrappedValue: Value) { value = wrappedValue }
}

final class Counter {
    @Atomic var count = 0

    func increment() {
        count += 1
    }
}
Open in playground
Report an error