qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/5] coroutine: Split qemu/coroutine-core.h off qemu/corou


From: Markus Armbruster
Subject: Re: [PATCH v3 4/5] coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h
Date: Thu, 22 Dec 2022 09:56:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 12/21/22 14:14, Markus Armbruster wrote:
>> +/**
>> + * Mark a function that executes in coroutine context
>> + *
>> + *
>> + * Functions that execute in coroutine context cannot be called
>> + * directly from normal functions.  Use @coroutine_fn to mark such
>> + * functions.  For example:
>> + *
>> + *   static void coroutine_fn foo(void) {
>> + *       ....
>> + *   }
>> + *
>> + * In the future it would be nice to have the compiler or a static
>> + * checker catch misuse of such functions.  This annotation might make
>> + * it possible and in the meantime it serves as documentation.
>> + */
>> +
>
> Is it intentional that "#define coroutine_fn" is not here?

Yes: I moved it to qemu/osdep.h in PATCH 2, along with its doc comment.
To avoid compromising coroutine.h as overview documentation, I added
rephrased documentation there.

This patch copies this rephrased documentation to coroutine-core.h.

I'm open to better ideas.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]