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

@@ -61,6 +61,11 @@ int async_pipe(OSSL_ASYNC_FD *pipefds)
return -1;
}
int async_close_fd(OSSL_ASYNC_FD fd)
{
return 0;
}
int async_write1(OSSL_ASYNC_FD fd, const void *buf)
{
return -1;
@@ -71,5 +76,10 @@ int async_read1(OSSL_ASYNC_FD fd, void *buf)
return -1;
}
int async_thread_local_init(void)
{
return 0;
}
#endif