[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked |
Date: |
Wed, 23 Feb 2022 09:48:00 +0000 |
On Wed, 23 Feb 2022 at 09:45, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 2/21/22 15:29, Stefan Hajnoczi wrote:
> > -static __thread bool iothread_locked = false;
> > +QEMU_DEFINE_STATIC_CO_TLS(bool, iothread_locked)
> >
> > bool qemu_mutex_iothread_locked(void)
> > {
> > - return iothread_locked;
> > + return get_iothread_locked();
> > }
> >
>
> Can we rename either the variable or the function, and avoid the wrapper
> altogether?
I think it's useful to distinguish the API for the rest of QEMU
(a function) from the implementation used internally (previously
a thread-local static, now a similar thing with wrappers.)
-- PMM
- Re: [PATCH v4 1/4] tls: add macros for coroutine-safe TLS variables, (continued)