Received: from eggs.gnu.org ([2001:4830:134:3::10]:57762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaSCo-0005Ff-Fl for qemu-devel@nongnu.org; Sun, 27 Oct 2013 11:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaSCh-0003QX-1w for qemu-devel@nongnu.org; Sun, 27 Oct 2013 11:24:42 -0400 Received: from mail6.webfaction.com ([74.55.86.74]:49708 helo=smtp.webfaction.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaSCg-0003QS-Si for qemu-devel@nongnu.org; Sun, 27 Oct 2013 11:24:34 -0400 From: Charlie Shepherd Date: Sun, 27 Oct 2013 16:23:55 +0100 Message-Id: <1382887436-17306-2-git-send-email-charlie@ctshepherd.com> In-Reply-To: <1382887436-17306-1-git-send-email-charlie@ctshepherd.com> References: <1382887436-17306-1-git-send-email-charlie@ctshepherd.com> Subject: [Qemu-devel] [PATCH v3 1/2] Add an explanation of when a function should be marked coroutine_fn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, gabriel@kerneis.info, charlie@ctshepherd.com, stefanha@gmail.com Coroutine functions that can yield directly or indirectly should be annotated with a coroutine_fn annotation. Add an explanation to that effect in include/block/coroutine.h. --- include/block/coroutine.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/block/coroutine.h b/include/block/coroutine.h index 4232569..e11a587 100644 --- a/include/block/coroutine.h +++ b/include/block/coroutine.h @@ -38,6 +38,14 @@ * static checker support for catching such errors. This annotation might make * it possible and in the meantime it serves as documentation. * + * A function must be marked with coroutine_fn if it can yield execution, either + * directly or indirectly. + * + * Some functions dynamically determine whether to yield or not based on + * whether they are executing in a coroutine context or not. These functions + * do not need to be annotated coroutine_fn. Note that this practice is + * deprecated and is being phased out, new code should not do this. + * * For example: * * static void coroutine_fn foo(void) { -- 1.8.4.rc3