Implement windows async thread local variable support

Implements Thread Local Storage in the windows async port. This also has
some knock on effects to the posix and null implementations.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Matt Caswell
2015-11-19 21:44:13 +00:00
parent 68487a9b06
commit 22a34c2fab
9 changed files with 127 additions and 17 deletions

View File

@@ -66,7 +66,7 @@ pthread_key_t posixpool;
#define STACKSIZE 32768
int async_thread_local_init(void)
int async_global_init(void)
{
if (pthread_key_create(&posixctx, NULL) != 0
|| pthread_key_create(&posixpool, NULL) != 0)
@@ -75,6 +75,22 @@ int async_thread_local_init(void)
return 1;
}
int async_local_init(void)
{
if (!async_set_ctx(NULL) || ! async_set_pool(NULL))
return 0;
return 1;
}
void async_local_cleanup(void)
{
}
void async_global_cleanup(void)
{
}
int async_fibre_init(async_fibre *fibre)
{
void *stack = NULL;