From: Peter Maydell <peter.maydell@linaro.org>
To: Hikaru Nishida <hikarupsp@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH v2] ui: Fix hanging up Cocoa display on macOS 10.15 (Catalina)
Date: Mon, 14 Oct 2019 18:16:44 +0100 [thread overview]
Message-ID: <CAFEAcA8nG9gLd3-mgpy6eTPfYPcpJDGS8EV-aRQPRTq=NuHYvA@mail.gmail.com> (raw)
In-Reply-To: <20191014141608.80923-1-hikarupsp@gmail.com>
On Mon, 14 Oct 2019 at 15:16, <hikarupsp@gmail.com> wrote:
>
> From: Hikaru Nishida <hikarupsp@gmail.com>
>
> macOS API documentation says that before applicationDidFinishLaunching
> is called, any events will not be processed. However, some events are
> fired before it is called in macOS Catalina. This causes deadlock of
> iothread_lock in handleEvent while it will be released after the
> app_started_sem is posted.
> This patch avoids processing events before the app_started_sem is
> posted to prevent this deadlock.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1847906
> Signed-off-by: Hikaru Nishida <hikarupsp@gmail.com>
> ---
> ui/cocoa.m | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index f12e21df6e..bccd861d16 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -134,6 +134,7 @@
>
> static QemuSemaphore display_init_sem;
> static QemuSemaphore app_started_sem;
> +volatile sig_atomic_t allow_events;
Sorry, I failed to spot this on version 1 of the patch...
I think we don't need to mark this 'volatile sig_atomic_t',
but could use a simple 'bool', because both applicationDidFinishLaunching()
and handleEvent() are called from the same thread (the OSX run loop
thread). Could you test that it still works with plain 'bool',
please?
(If we did need to handle multiple thread accesses we should
probably prefer one of the QEMU atomic primitives described
in docs/devel/atomics.txt, since 'volatile' isn't really sufficient.)
thanks
-- PMM
next prev parent reply other threads:[~2019-10-14 17:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 14:16 [PATCH v2] ui: Fix hanging up Cocoa display on macOS 10.15 (Catalina) hikarupsp
2019-10-14 17:16 ` Peter Maydell [this message]
2019-10-15 1:08 ` Hikaru Nishida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFEAcA8nG9gLd3-mgpy6eTPfYPcpJDGS8EV-aRQPRTq=NuHYvA@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=hikarupsp@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).