mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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>
This commit is contained in:
parent
c170aad8b0
commit
ab28bd2312
5 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue