Implement local thread pools

Implement the ASYNC_JOB as a local thread pool. Remove the API support
for global pools.

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Matt Caswell
2015-09-16 17:01:58 +01:00
parent f4da39d200
commit 0ff2b9ac0b
6 changed files with 76 additions and 24 deletions

View File

@@ -52,6 +52,7 @@
*/
#include <openssl/async.h>
#include <openssl/crypto.h>
typedef struct async_ctx_st ASYNC_CTX;
@@ -75,4 +76,14 @@ struct async_job_st {
int wake_fd;
};
DECLARE_STACK_OF(ASYNC_JOB)
void ASYNC_start_func(void);
STACK_OF(ASYNC_JOB) *async_get_pool(void);
void async_set_pool(STACK_OF(ASYNC_JOB) *poolin, size_t curr_size,
size_t max_size);
void async_increment_pool_size(void);
void async_release_job_to_pool(ASYNC_JOB *job);
size_t async_pool_max_size(void);
void async_release_pool(void);
int async_pool_can_grow(void);