CRYPTO_THREAD_init_local

Allocate a thread-local storage key for use with CRYPTO_THREAD_get/set_local().

Synopsis

Declared in <openssl/crypto.h>

int
CRYPTO_THREAD_init_local(
    CRYPTO_THREAD_LOCAL* key,
    void(* cleanup)(void*));

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
keyReceives the new key on success.
cleanupOptional destructor invoked on thread exit for non-NULL values, or NULL.