Convert ASYNC code to use new Thread API

The async code uses thread local variables. We should convert to using
the new Thread API for doing this.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Matt Caswell
2016-03-02 16:15:52 +00:00
parent 0c452abc16
commit 224905f8aa
8 changed files with 31 additions and 114 deletions

View File

@@ -68,20 +68,12 @@
# include <setjmp.h>
# include "e_os.h"
extern pthread_key_t posixctx;
extern pthread_key_t posixpool;
typedef struct async_fibre_st {
ucontext_t fibre;
jmp_buf env;
int env_init;
} async_fibre;
# define async_set_ctx(nctx) (pthread_setspecific(posixctx , (nctx)) == 0)
# define async_arch_get_ctx() ((async_ctx *)pthread_getspecific(posixctx))
# define async_set_pool(p) (pthread_setspecific(posixpool , (p)) == 0)
# define async_get_pool() ((async_pool *)pthread_getspecific(posixpool))
static inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
{
o->env_init = 1;