qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sigfd: use pthread_sigmask


From: Alexandre Raymond
Subject: Re: [Qemu-devel] [PATCH] sigfd: use pthread_sigmask
Date: Wed, 8 Jun 2011 19:19:33 -0400

On Wed, Jun 8, 2011 at 6:55 PM, Alexander Graf <address@hidden> wrote:
> Qemu uses signalfd to figure out, if a signal occured without the need
> to actually receive the signal. Instead, it can read from the fd to receive
> its news.
>
> Now, we obviously don't always have signalfd around. Especially not on
> non-Linux systems. So what we do there is that we create a new thread,
> block that thread on all signals and simply call sigwait to wait for a
> signal we're interested in to occur.
>
> This all sounds great, but what we're really doing is:
>
>    sigset_t all;
>
>    sigfillset(&all);
>    sigprocmask(SIG_BLOCK, &all, NULL);
>
> which - on Darwin - blocks all signals on the current _process_, not only
> on the current thread. To block signals on the thread, we can use
> pthread_sigmask().
>
> This patch does that, assuming that my above analysis is correct, and thus
> renders Qemu useable on Darwin again.
I confirm that Qemu works much better on Darwin with this patch :)

Thanks!
Alexandre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]