All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Block I/O signals in audio helper threads.
@ 2010-08-06  8:05 Gerd Hoffmann
  2010-08-06  8:27 ` [Qemu-devel] " Paolo Bonzini
  2010-08-06  9:17 ` [Qemu-devel] " malc
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2010-08-06  8:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Otherwise qemu might be killed due to SIGIO being received by a thread
which isn't prepared for that.  Seen happening with pulseaudio backend.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/audio_pt_int.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c
index e889a98..0e5aa2c 100644
--- a/audio/audio_pt_int.c
+++ b/audio/audio_pt_int.c
@@ -1,5 +1,6 @@
 #include "qemu-common.h"
 #include "audio.h"
+#include <signal.h>
 
 #define AUDIO_CAP "audio-pt"
 
@@ -23,6 +24,7 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (void *),
 {
     int err, err2;
     const char *efunc;
+    sigset_t set, old;
 
     p->drv = drv;
 
@@ -38,7 +40,14 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (void *),
         goto err1;
     }
 
+    sigemptyset(&set);
+    sigaddset(&set, SIGUSR2);
+    sigaddset(&set, SIGIO);
+    sigaddset(&set, SIGALRM);
+
+    pthread_sigmask(SIG_BLOCK, &set, &old);
     err = pthread_create (&p->thread, NULL, func, opaque);
+    pthread_sigmask(SIG_SETMASK, &old, NULL);
     if (err) {
         efunc = "pthread_create";
         goto err2;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] Block I/O signals in audio helper threads.
  2010-08-06  8:05 [Qemu-devel] [PATCH] Block I/O signals in audio helper threads Gerd Hoffmann
@ 2010-08-06  8:27 ` Paolo Bonzini
  2010-08-06  9:17 ` [Qemu-devel] " malc
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2010-08-06  8:27 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 08/06/2010 10:05 AM, Gerd Hoffmann wrote:
> Otherwise qemu might be killed due to SIGIO being received by a thread
> which isn't prepared for that.  Seen happening with pulseaudio backend.

For 0.14 it may make sense to switch it qemu-threads, which would do 
that automatically.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Block I/O signals in audio helper threads.
  2010-08-06  8:05 [Qemu-devel] [PATCH] Block I/O signals in audio helper threads Gerd Hoffmann
  2010-08-06  8:27 ` [Qemu-devel] " Paolo Bonzini
@ 2010-08-06  9:17 ` malc
  1 sibling, 0 replies; 3+ messages in thread
From: malc @ 2010-08-06  9:17 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Fri, 6 Aug 2010, Gerd Hoffmann wrote:

> Otherwise qemu might be killed due to SIGIO being received by a thread
> which isn't prepared for that.  Seen happening with pulseaudio backend.

I've commited different patch.

[..snip..]

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-06  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-06  8:05 [Qemu-devel] [PATCH] Block I/O signals in audio helper threads Gerd Hoffmann
2010-08-06  8:27 ` [Qemu-devel] " Paolo Bonzini
2010-08-06  9:17 ` [Qemu-devel] " malc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.