mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43: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
|
@ -18,6 +18,7 @@
|
|||
#include "sysemu/iothread.h"
|
||||
#include "qmp-commands.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/rcu.h"
|
||||
|
||||
typedef ObjectClass IOThreadClass;
|
||||
|
||||
|
@ -31,6 +32,8 @@ static void *iothread_run(void *opaque)
|
|||
IOThread *iothread = opaque;
|
||||
bool blocking;
|
||||
|
||||
rcu_register_thread();
|
||||
|
||||
qemu_mutex_lock(&iothread->init_done_lock);
|
||||
iothread->thread_id = qemu_get_thread_id();
|
||||
qemu_cond_signal(&iothread->init_done_cond);
|
||||
|
@ -45,6 +48,8 @@ static void *iothread_run(void *opaque)
|
|||
}
|
||||
aio_context_release(iothread->ctx);
|
||||
}
|
||||
|
||||
rcu_unregister_thread();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue