Swap to using _longjmp/_setjmp instead of longjmp/setjmp
authorMatt Caswell <matt@openssl.org>
Fri, 9 Oct 2015 14:55:01 +0000 (15:55 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 20 Nov 2015 23:35:19 +0000 (23:35 +0000)
_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 <rsalz@openssl.org>
crypto/async/arch/async_posix.h

index 650d918ed40633ebcdb850781ffe4ef7c201992c..0e6a0a06625b223263fa793e26eb5c6a83ed35fa 100644 (file)
@@ -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);
     }