rcu: actually register threads that have RCU read-side critical sections
Otherwise, grace periods are detected too early!
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c
index 4c5f62e..daa8bf4 100644
--- a/tests/test-rcu-list.c
+++ b/tests/test-rcu-list.c
@@ -108,6 +108,8 @@
long long n_reads_local = 0;
struct list_element *el;
+ rcu_register_thread();
+
*(struct rcu_reader_data **)arg = &rcu_reader;
atomic_inc(&nthreadsrunning);
while (goflag == GOFLAG_INIT) {
@@ -129,6 +131,8 @@
qemu_mutex_lock(&counts_mutex);
n_reads += n_reads_local;
qemu_mutex_unlock(&counts_mutex);
+
+ rcu_unregister_thread();
return NULL;
}