diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-08-12 16:32:20 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-08-15 15:43:15 +0200 |
commit | 1cbfe2b8fccb86a20039867fc33bc475f358f8e4 (patch) | |
tree | f4c828f22851e36077bbcdc83653c6eca7fa5db3 /gtk/continuation.h | |
parent | a73f841b59faadccec2c0c410f15149d4a5cb5bb (diff) |
use _setjmp/_longjmp to speed up coroutine switching
As described in http://www.1024cores.net/home/lock-free-algorithms/tricks/fibers
Diffstat (limited to 'gtk/continuation.h')
-rw-r--r-- | gtk/continuation.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/continuation.h b/gtk/continuation.h index 87cd4ee..1247337 100644 --- a/gtk/continuation.h +++ b/gtk/continuation.h @@ -23,6 +23,7 @@ #include <stddef.h> #include <ucontext.h> +#include <setjmp.h> struct continuation { @@ -35,6 +36,7 @@ struct continuation ucontext_t uc; ucontext_t last; int exited; + jmp_buf jmp; }; int cc_init(struct continuation *cc); |