aboutsummaryrefslogtreecommitdiff
path: root/qemu-thread.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-06-03 15:20:32 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-06-14 15:46:28 -0500
commit55541c8afc1a2d75de890c6ee858769d7d605526 (patch)
treef15320a0cb2a58acf89f4e48c71bf1e3254dba0e /qemu-thread.c
parent304e3a7c802969811fe82b6247f63fcba063f52e (diff)
make qemu_thread_create block all signals
All signals will thus be routed through the IO thread. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-thread.c')
-rw-r--r--qemu-thread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-thread.c b/qemu-thread.c
index 3923db74ee..faf406142d 100644
--- a/qemu-thread.c
+++ b/qemu-thread.c
@@ -137,9 +137,16 @@ void qemu_thread_create(QemuThread *thread,
{
int err;
+ /* Leave signal handling to the iothread. */
+ sigset_t set, oldset;
+
+ sigfillset(&set);
+ pthread_sigmask(SIG_SETMASK, &set, &oldset);
err = pthread_create(&thread->thread, NULL, start_routine, arg);
if (err)
error_exit(err, __func__);
+
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
}
void qemu_thread_signal(QemuThread *thread, int sig)