mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
Revert "rcu: do not create thread in pthread_atfork callback"
This reverts commit a59629fcc6
.
This is not needed anymore because the IOThread mutex is not
"magic" anymore (need not kick the CPU thread)and also because
fork callbacks are only enabled at the very beginning of
QEMU's execution.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
73c6e4013b
commit
2a96a552f9
4 changed files with 7 additions and 7 deletions
10
util/rcu.c
10
util/rcu.c
|
@ -350,18 +350,22 @@ static void rcu_init_unlock(void)
|
|||
qemu_mutex_unlock(&rcu_registry_lock);
|
||||
qemu_mutex_unlock(&rcu_sync_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
void rcu_after_fork(void)
|
||||
static void rcu_init_child(void)
|
||||
{
|
||||
if (atfork_depth < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
memset(®istry, 0, sizeof(registry));
|
||||
rcu_init_complete();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __attribute__((__constructor__)) rcu_init(void)
|
||||
{
|
||||
#ifdef CONFIG_POSIX
|
||||
pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_unlock);
|
||||
pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child);
|
||||
#endif
|
||||
rcu_init_complete();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue