[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: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v4 4/4] cpus: use coroutine TLS macros for iothread_locked |
Date: |
Tue, 22 Feb 2022 13:25:45 +0000 |
On Mon, Feb 21, 2022 at 04:09:06PM +0100, Philippe Mathieu-Daudé wrote:
> On 21/2/22 15:29, Stefan Hajnoczi wrote:
> > qemu_mutex_iothread_locked() may be used from coroutines. Standard
> > __thread variables cannot be used by coroutines. Use the coroutine TLS
> > macros instead.
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> > softmmu/cpus.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/softmmu/cpus.c b/softmmu/cpus.c
> > index 035395ae13..005a5c31ef 100644
> > --- a/softmmu/cpus.c
> > +++ b/softmmu/cpus.c
> > @@ -473,11 +473,11 @@ bool qemu_in_vcpu_thread(void)
> > return current_cpu && qemu_cpu_is_self(current_cpu);
> > }
> > -static __thread bool iothread_locked = false;
> > +QEMU_DEFINE_STATIC_CO_TLS(bool, iothread_locked)
>
> While "qemu/coroutine-tls.h" is indirectly included by "rcu.h",
> please include it explicitly.
Thanks, will fix.
Stefan
signature.asc
Description: PGP signature
- [PATCH v4 1/4] tls: add macros for coroutine-safe TLS variables, (continued)