From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56925 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgZnC-00036B-90 for qemu-devel@nongnu.org; Sat, 22 Jan 2011 04:30:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgZn9-0001m6-GC for qemu-devel@nongnu.org; Sat, 22 Jan 2011 04:29:58 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:47066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgZn9-0001lf-5o for qemu-devel@nongnu.org; Sat, 22 Jan 2011 04:29:55 -0500 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0M9Ts9a009769 for ; Sat, 22 Jan 2011 09:29:54 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0M9TuDc1618064 for ; Sat, 22 Jan 2011 09:29:56 GMT Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0M9Tref028163 for ; Sat, 22 Jan 2011 02:29:53 -0700 From: Stefan Hajnoczi Date: Sat, 22 Jan 2011 09:29:19 +0000 Message-Id: <1295688567-25496-5-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1295688567-25496-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1295688567-25496-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC][PATCH 04/12] coroutine: Use thread-local leader and current variables List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi Each pthread should have its own current coroutine. This ensures coroutines are thread-safe. Signed-off-by: Stefan Hajnoczi --- coroutine_ucontext.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/coroutine_ucontext.c b/coroutine_ucontext.c index f76da94..289e5bd 100644 --- a/coroutine_ucontext.c +++ b/coroutine_ucontext.c @@ -70,13 +70,8 @@ int coroutine_init(struct coroutine *co) return cc_init(&co->cc); } -#if 0 static __thread struct coroutine leader; static __thread struct coroutine *current; -#else -static struct coroutine leader; -static struct coroutine *current; -#endif struct coroutine *coroutine_self(void) { -- 1.7.2.3