Docs/RCU: Correct sample code of qatomic_rcu_set

Correct sample code to avoid confusing readers.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Cc: qemu-trivial@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210106071710.15836-1-zhukeqian1@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Keqian Zhu 2021-01-06 15:17:10 +08:00 committed by Paolo Bonzini
parent b9a0de3773
commit d533d6359b

View File

@ -392,7 +392,7 @@ Instead, we store the size of the array with the array itself:
/* Removal phase. */
old_array = global_array;
qatomic_rcu_set(&new_array->data, new_array);
qatomic_rcu_set(&global_array, new_array);
synchronize_rcu();
/* Reclamation phase. */