qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC][PATCH 04/12] coroutine: Use thread-local leader and c


From: Stefan Hajnoczi
Subject: [Qemu-devel] [RFC][PATCH 04/12] coroutine: Use thread-local leader and current variables
Date: Sat, 22 Jan 2011 09:29:19 +0000

Each pthread should have its own current coroutine.  This ensures
coroutines are thread-safe.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 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




reply via email to

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