undoing replacement of critical section with atomic operation