On Sat, 5 Feb 2022 at 02:06, Akihiko Odaki <akihiko.od...@gmail.com> wrote: > > On Sat, Feb 5, 2022 at 1:19 AM Peter Maydell <peter.mayd...@linaro.org> wrote
> > (1) A question for Akihiko: > > Are all the cocoa calls we make in updateUIInfo safe to > > make from a non-UI thread? Would it be preferable for this > > call in cocoa_switch() to be moved inside the dispatch_async block? > > (Moving it would mean that I wouldn't have to think about whether > > any of the code in it needs to have an autorelease pool :-)) > > It is not safe. Apparently I totally forgot about threads when I wrote this. > > It should be moved in the dispatch_async block as you suggest. Should > I write a patch, or will you write one before you delete autorelease > pools? I'll write a patchset. If you have time to test it when I send it out that would be great. Incidentally, I think the answer to my other question > > Is it safe to call dpy_set_ui_info() from a non-QEMU-main-thread? is "no, and so the body of updateUIInfo should be enclosed in a with_iothread_lock block". -- PMM