diff options
Diffstat (limited to 'crypto/async/arch/async_win.c')
-rw-r--r-- | crypto/async/arch/async_win.c | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/crypto/async/arch/async_win.c b/crypto/async/arch/async_win.c index c0776b1239..6b948c3d9c 100644 --- a/crypto/async/arch/async_win.c +++ b/crypto/async/arch/async_win.c @@ -58,38 +58,9 @@ # include <windows.h> # include "internal/cryptlib.h" -struct winpool { - STACK_OF(ASYNC_JOB) *pool; - size_t curr_size; - size_t max_size; -}; - -static DWORD asyncwinpool = 0; -static DWORD asyncwinctx = 0; - - -void async_start_func(void); - -int async_global_init(void) -{ - asyncwinpool = TlsAlloc(); - asyncwinctx = TlsAlloc(); - if (asyncwinpool == TLS_OUT_OF_INDEXES - || asyncwinctx == TLS_OUT_OF_INDEXES) { - if (asyncwinpool != TLS_OUT_OF_INDEXES) { - TlsFree(asyncwinpool); - } - if (asyncwinctx != TLS_OUT_OF_INDEXES) { - TlsFree(asyncwinctx); - } - return 0; - } - return 1; -} - void async_local_cleanup(void) { - async_ctx *ctx = async_arch_get_ctx(); + async_ctx *ctx = async_get_ctx(); if (ctx != NULL) { async_fibre *fibre = &ctx->dispatcher; if(fibre != NULL && fibre->fibre != NULL && fibre->converted) { @@ -99,14 +70,6 @@ void async_local_cleanup(void) } } -void async_global_cleanup(void) -{ - TlsFree(asyncwinpool); - TlsFree(asyncwinctx); - asyncwinpool = 0; - asyncwinctx = 0; -} - int async_fibre_init_dispatcher(async_fibre *fibre) { fibre->fibre = ConvertThreadToFiber(NULL); @@ -127,25 +90,4 @@ VOID CALLBACK async_start_func_win(PVOID unused) async_start_func(); } -async_pool *async_get_pool(void) -{ - return (async_pool *)TlsGetValue(asyncwinpool); -} - - -int async_set_pool(async_pool *pool) -{ - return TlsSetValue(asyncwinpool, (LPVOID)pool) != 0; -} - -async_ctx *async_arch_get_ctx(void) -{ - return (async_ctx *)TlsGetValue(asyncwinctx); -} - -int async_set_ctx(async_ctx *ctx) -{ - return TlsSetValue(asyncwinctx, (LPVOID)ctx) != 0; -} - #endif |