summaryrefslogtreecommitdiff
path: root/include/openssl/async.h
diff options
context:
space:
mode:
authorPing Yu <ping.yu@intel.com>2018-11-05 15:41:01 -0500
committerMatt Caswell <matt@openssl.org>2019-01-27 12:27:17 +0000
commit9f5a87fd665cb597fa1c1f4eef882d2d2f833e61 (patch)
tree3bad8287fe464c81267aa7cf43a41344fd6db414 /include/openssl/async.h
parent61e033308b1c004bd808352fb1d786547dcdf62b (diff)
downloadopenssl-new-9f5a87fd665cb597fa1c1f4eef882d2d2f833e61.tar.gz
add an additional async notification communication method based on callback
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Signed-off-by: Ping Yu <ping.yu@intel.com> Signed-off-by: Steven Linsell <stevenx.linsell@intel.com> (Merged from https://github.com/openssl/openssl/pull/7573)
Diffstat (limited to 'include/openssl/async.h')
-rw-r--r--include/openssl/async.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/openssl/async.h b/include/openssl/async.h
index 71aef3bf98..910c144c6b 100644
--- a/include/openssl/async.h
+++ b/include/openssl/async.h
@@ -31,12 +31,18 @@ extern "C" {
typedef struct async_job_st ASYNC_JOB;
typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
+typedef int (*ASYNC_callback_fn)(void *arg);
#define ASYNC_ERR 0
#define ASYNC_NO_JOBS 1
#define ASYNC_PAUSE 2
#define ASYNC_FINISH 3
+#define ASYNC_STATUS_UNSUPPORTED 0
+#define ASYNC_STATUS_ERR 1
+#define ASYNC_STATUS_OK 2
+#define ASYNC_STATUS_EAGAIN 3
+
int ASYNC_init_thread(size_t max_size, size_t init_size);
void ASYNC_cleanup_thread(void);
@@ -52,6 +58,14 @@ int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
OSSL_ASYNC_FD *fd, void **custom_data);
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
size_t *numfds);
+int ASYNC_WAIT_CTX_get_callback(ASYNC_WAIT_CTX *ctx,
+ ASYNC_callback_fn *callback,
+ void **callback_arg);
+int ASYNC_WAIT_CTX_set_callback(ASYNC_WAIT_CTX *ctx,
+ ASYNC_callback_fn callback,
+ void *callback_arg);
+int ASYNC_WAIT_CTX_set_status(ASYNC_WAIT_CTX *ctx, int status);
+int ASYNC_WAIT_CTX_get_status(ASYNC_WAIT_CTX *ctx);
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
size_t *numdelfds);