[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.
- [PATCH v3 0/5] coroutine: Clean up includes, Markus Armbruster, 2022/12/21
- [PATCH v3 5/5] coroutine: Use Coroutine typedef name instead of structure tag, Markus Armbruster, 2022/12/21
- [PATCH v3 2/5] coroutine: Move coroutine_fn to qemu/osdep.h, trim includes, Markus Armbruster, 2022/12/21
- [PATCH v3 1/5] coroutine: Clean up superfluous inclusion of qemu/coroutine.h, Markus Armbruster, 2022/12/21
- Re: [PATCH v3 0/5] coroutine: Clean up includes, Philippe Mathieu-Daudé, 2022/12/21