Because you determine whether to free _and_ whether another threads is in the way at the same time you do the decrementing. A `lock cmpxchg` (intel/amd) instruction can be used for that.