[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 1/7] ui/cocoa: Ensure we have the iothread lo
From: |
G 3 |
Subject: |
Re: [Qemu-devel] [PATCH v3 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU |
Date: |
Thu, 28 Feb 2019 16:53:45 -0500 |
On Mon, Feb 25, 2019 at 5:24 AM Peter Maydell <address@hidden>
wrote:
> The Cocoa UI should run on the main thread; this is enforced
> in OSX Mojave. In order to be able to run on the main thread,
> we need to make sure we hold the iothread lock whenever we
> call into various QEMU UI midlayer functions.
>
> Signed-off-by: Peter Maydell <address@hidden>
> Reviewed-by: Roman Bolshakov <address@hidden>
> Tested-by: Roman Bolshakov <address@hidden>
> Message-id: address@hidden
> ---
> Changes since v2: add with_iothread_lock wrap to the
> qmp_stop()/qmp_cont() calls
> ---
> ui/cocoa.m | 91 ++++++++++++++++++++++++++++++++++++++----------------
> 1 file changed, 65 insertions(+), 26 deletions(-)
>
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index e2567d6946..f1171c4865 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -129,6 +129,21 @@
> NSTextField *pauseLabel;
> NSArray * supportedImageFileTypes;
>
> +// Utility function to run specified code block with iothread lock held
> +typedef void (^CodeBlock)(void);
>
Please don't use blocks. It would lock Mac OS X users into having to use
CLang. GCC does not support this non-standard extension.
C function pointers and Objective-C's selectors could work in place of
blocks.
Thank you.
- [Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 3/7] ui/cocoa: Factor out initial menu creation, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU, Peter Maydell, 2019/02/25
- Re: [Qemu-devel] [PATCH v3 1/7] ui/cocoa: Ensure we have the iothread lock when calling into QEMU,
G 3 <=
- [Qemu-devel] [PATCH v3 2/7] ui/cocoa: Use the pixman image directly in switchSurface, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 4/7] ui/cocoa: Move console/device menu creation code up in file, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 7/7] ui/cocoa: Perform UI operations only on the main thread, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 6/7] ui/cocoa: Subclass NSApplication so we can implement sendEvent, Peter Maydell, 2019/02/25
- [Qemu-devel] [PATCH v3 5/7] ui/cocoa: Don't call NSApp sendEvent directly from handleEvent, Peter Maydell, 2019/02/25
- Re: [Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop, Peter Maydell, 2019/02/25