Add a check if max atomic_shared_ptrs is reached.