qemu-block
[Top][All Lists]
Advanced

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

Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations
Date: Tue, 8 Nov 2022 19:30:15 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 11/8/22 19:19, Vladimir Sementsov-Ogievskiy wrote:
This is a lot better than our "coroutine_fn" sign, which actually do no check (and can't 
do). Don't you plan to swap a "coroutine_fn" noop marker with more meaningful 
IN_COROUTINE(); (or something like this, which just do assert(qemu_in_coroutine())) at start of the 
function? It would be a lot safer.


Moreover, we can introduce two macros:

IN_COROUTINE() and NOT_COROUTINE(), mark functions correspondingly and drop 
coroutine_fn mark. Than the picture would be very deterministic:

IN_COROUTINE - function is called only from coroutine context
NOT_COROUTINE - function is never called from coroutine context
<no mark> - function may be called from both coroutine and non-coroutine context

--
Best regards,
Vladimir




reply via email to

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