Re: [Qemu-devel] [PATCH 01/35] WIP: coroutine: annotate coroutine with clang thread safety attributes

2017-07-05 Thread Marc-André Lureau
Hi - Original Message - > On 05/07/2017 00:03, Marc-André Lureau wrote: > > +typedef int TAA_ROLE coroutine_role; > > +extern coroutine_role _coroutine_fn; > > + > > +static inline void co_role_acquire(coroutine_role R) TAA_ACQUIRE(R) > > TAA_NO_ANALYSYS {} > > +static inline void

Re: [Qemu-devel] [PATCH 01/35] WIP: coroutine: annotate coroutine with clang thread safety attributes

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 00:03, Marc-André Lureau wrote: > +typedef int TAA_ROLE coroutine_role; > +extern coroutine_role _coroutine_fn; > + > +static inline void co_role_acquire(coroutine_role R) TAA_ACQUIRE(R) > TAA_NO_ANALYSYS {} > +static inline void co_role_release(coroutine_role R) TAA_RELEASE(R) >

[Qemu-devel] [PATCH 01/35] WIP: coroutine: annotate coroutine with clang thread safety attributes

2017-07-04 Thread Marc-André Lureau
It is possible to use clang -Wthread-safety to do some basic coroutine checks: http://lists.llvm.org/pipermail/cfe-dev/2017-June/054372.html https://clang.llvm.org/docs/ThreadSafetyAnalysis.html This will basically check that you don't call accidentally a coroutine function from a non-coroutine,