diff options
author | Matt Caswell <matt@openssl.org> | 2016-03-07 16:55:39 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-03-07 17:23:42 +0000 |
commit | 667867cced0013c1cfd8d7a9efa43b8f2cebc942 (patch) | |
tree | 2bf118d9a4d87308f837fecfa658d79fee4356c0 /crypto/async | |
parent | b8972edad65a5245645f40654b903dbcd1a4d5c1 (diff) | |
download | openssl-667867cced0013c1cfd8d7a9efa43b8f2cebc942.tar.gz |
Add a function to detect if we have async or not
Add the ASYNC_is_capable() function and use it in speed.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/async')
-rw-r--r-- | crypto/async/arch/async_null.c | 5 | ||||
-rw-r--r-- | crypto/async/arch/async_posix.c | 6 | ||||
-rw-r--r-- | crypto/async/arch/async_win.c | 5 |
3 files changed, 15 insertions, 1 deletions
diff --git a/crypto/async/arch/async_null.c b/crypto/async/arch/async_null.c index 7b93090a9a..f0b8a5c315 100644 --- a/crypto/async/arch/async_null.c +++ b/crypto/async/arch/async_null.c @@ -55,6 +55,11 @@ #ifdef ASYNC_NULL +int ASYNC_is_capable(void) +{ + return 0; +} + void async_local_cleanup(void) { } diff --git a/crypto/async/arch/async_posix.c b/crypto/async/arch/async_posix.c index 553ec664e2..2d9e5102fc 100644 --- a/crypto/async/arch/async_posix.c +++ b/crypto/async/arch/async_posix.c @@ -60,10 +60,14 @@ #define STACKSIZE 32768 -void async_local_cleanup(void) +int ASYNC_is_capable(void) { + return 1; } +void async_local_cleanup(void) +{ +} int async_fibre_makecontext(async_fibre *fibre) { diff --git a/crypto/async/arch/async_win.c b/crypto/async/arch/async_win.c index 6b948c3d9c..4f4c799e98 100644 --- a/crypto/async/arch/async_win.c +++ b/crypto/async/arch/async_win.c @@ -58,6 +58,11 @@ # include <windows.h> # include "internal/cryptlib.h" +int ASYNC_is_capable(void) +{ + return 1; +} + void async_local_cleanup(void) { async_ctx *ctx = async_get_ctx(); |