Use only one `pthread` "key"
nicowilliams opened this issue · 0 comments
nicowilliams commented
Calling pthread_key_create()
every time thread_safe_var_init()
is called is too resource intensive in that some C libraries only support a limited number of keys. We only need one key as we use them just to drive cleanup on thread exit.
This is important if libraries like OpenSSL are going to use this.