[Spice-devel] [PATCH spice-gtk 2/4] coroutine: fix current coroutine

Marc-André Lureau marcandre.lureau at gmail.com
Fri Nov 15 13:03:40 PST 2013


When leaving a coroutine, it swaps back to where it came from, not to
the leader/main coroutine.
---
 gtk/coroutine_ucontext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/coroutine_ucontext.c b/gtk/coroutine_ucontext.c
index 6251528..889f0d6 100644
--- a/gtk/coroutine_ucontext.c
+++ b/gtk/coroutine_ucontext.c
@@ -103,7 +103,7 @@ void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
 		return from->data;
 	else if (ret == 1) {
 		coroutine_release(to);
-		current = &leader;
+		current = from;
 		to->exited = 1;
 		return to->data;
 	}
-- 
1.8.3.1



More information about the Spice-devel mailing list