diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-09 08:55:38 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-24 13:57:45 +0200 |
commit | ab28bd23125fb4a0411c3a3f01c4edacbc261486 (patch) | |
tree | 50cf40b9f83a43d2a7b6dee4a801e6c31fc409ee /tests/test-rcu-list.c | |
parent | c170aad8b057223b1139d72e5ce7acceafab4fa9 (diff) | |
download | qemu-ab28bd23125fb4a0411c3a3f01c4edacbc261486.zip qemu-ab28bd23125fb4a0411c3a3f01c4edacbc261486.tar.gz qemu-ab28bd23125fb4a0411c3a3f01c4edacbc261486.tar.bz2 |
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>
Diffstat (limited to 'tests/test-rcu-list.c')
-rw-r--r-- | tests/test-rcu-list.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 @@ static void *rcu_q_reader(void *arg) 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 @@ static void *rcu_q_reader(void *arg) qemu_mutex_lock(&counts_mutex); n_reads += n_reads_local; qemu_mutex_unlock(&counts_mutex); + + rcu_unregister_thread(); return NULL; } |