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