From 06b9ff06cc7fdd8f51abb92aaac39d3988a7090e Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 9 Oct 2015 15:55:01 +0100 Subject: [PATCH] Swap to using _longjmp/_setjmp instead of longjmp/setjmp _longjmp/_setjmp do not manipulate the signal mask whilst longjmp/setjmp may do. Online sources suggest this could result in a significant speed up in the context switching. Reviewed-by: Rich Salz --- crypto/async/arch/async_posix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/async/arch/async_posix.h b/crypto/async/arch/async_posix.h index 650d918ed4..0e6a0a0662 100644 --- a/crypto/async/arch/async_posix.h +++ b/crypto/async/arch/async_posix.h @@ -80,9 +80,9 @@ static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r) { o->env_init = 1; - if (!r || !setjmp(o->env)) { + if (!r || !_setjmp(o->env)) { if (n->env_init) - longjmp(n->env, 1); + _longjmp(n->env, 1); else setcontext(&n->fibre); } -- 2.40.0