[RFC,04/12] coroutine: Use thread-local leader and current variables

Message ID 1295688567-25496-5-git-send-email-stefanha@linux.vnet.ibm.com
State New
Headers show

Commit Message

Stefan Hajnoczi Jan. 22, 2011, 9:29 a.m.
Each pthread should have its own current coroutine.  This ensures
coroutines are thread-safe.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
 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;
-static struct coroutine leader;
-static struct coroutine *current;
 struct coroutine *coroutine_self(void)