Convert __thread to pthreads for Thread Local Storage

In theory the pthreads approach for Thread Local Storage should be more
portable.

This also changes some APIs in order to accommodate this change. In
particular ASYNC_init_pool is renamed ASYNC_init_thread and
ASYNC_free_pool is renamed ASYNC_cleanup_thread. Also introduced ASYNC_init
and ASYNC_cleanup.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Matt Caswell
2015-11-13 23:54:44 +00:00
parent 27949c353e
commit 68487a9b06
12 changed files with 122 additions and 74 deletions

View File

@@ -1660,7 +1660,7 @@ int s_server_main(int argc, char *argv[])
if (async) {
SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
ASYNC_init_pool(0, 0);
ASYNC_init(1, 0, 0);
}
#ifndef OPENSSL_NO_SRTP
@@ -1974,7 +1974,7 @@ int s_server_main(int argc, char *argv[])
BIO_free(bio_s_msg);
bio_s_msg = NULL;
if (async) {
ASYNC_free_pool();
ASYNC_cleanup(1);
}
return (ret);
}