Problem using OSAtomic functions