aboutsummaryrefslogtreecommitdiff
path: root/main-loop.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-02 15:43:24 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-02 13:07:55 -0500
commit49cf57281b74ccb64587ccc0626fc55a01227a15 (patch)
tree3b57b04f25cdaf958add7c26d96a0a3e38ca74ab /main-loop.c
parentf9ab4654e370ceedb745523b607a628e297cb6ab (diff)
downloadqemu-49cf57281b74ccb64587ccc0626fc55a01227a15.zip
qemu-49cf57281b74ccb64587ccc0626fc55a01227a15.tar.gz
qemu-49cf57281b74ccb64587ccc0626fc55a01227a15.tar.bz2
vl: delay thread initialization after daemonization
Commit ac4119c (chardev: Use timer instead of bottom-half to postpone open event, 2012-10-12) moved the alarm timer initialization to an earlier point but failed to consider that it depends on qemu_init_main_loop. Later, commit 1c53786 (vl: init main loop earlier, 2012-10-30) fixed this, but left -daemonize in two different ways. First, timers need to be reinitialized after forking. Second, the global mutex was being held by the parent, and thus dropped after forking. The first is now fixed using pthread_atfork. For the second part, make sure that the global mutex is not taken before daemonization, and similarly delay qemu_thread_self. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'main-loop.c')
-rw-r--r--main-loop.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/main-loop.c b/main-loop.c
index 234a313..c87624e 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -128,7 +128,6 @@ int qemu_init_main_loop(void)
exit(1);
}
- qemu_mutex_lock_iothread();
ret = qemu_signal_init();
if (ret) {
return ret;