[#CRYPTO_THREAD_init_local]
= CRYPTO&lowbar;THREAD&lowbar;init&lowbar;local
:mrdocs:

Allocate a thread&hyphen;local storage key for use with CRYPTO&lowbar;THREAD&lowbar;get&sol;set&lowbar;local()&period;

== Synopsis

Declared in `&lt;openssl&sol;crypto&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;THREAD&lowbar;init&lowbar;local(
    xref:CRYPTO_THREAD_LOCAL.adoc[CRYPTO&lowbar;THREAD&lowbar;LOCAL]* key,
    void(* cleanup)(void*));
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| Receives the new key on success&period;
| *cleanup*
| Optional destructor invoked on thread exit for non&hyphen;NULL values, or NULL&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
