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 <rsalz@openssl.org>
This commit is contained in:
Matt Caswell 2015-10-09 15:55:01 +01:00
parent 4abc76811a
commit 06b9ff06cc

View 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);
}