vtls: make curl_global_sslset thread-safe

.. and update some docs to explain curl_global_* is now thread-safe.

Follow-up to 23af112 which made curl_global_init/cleanup thread-safe.

Closes https://github.com/curl/curl/pull/9016
This commit is contained in:
Jay Satiro 2022-06-15 02:20:49 -04:00
parent 9135275f86
commit a8a4abb2ae
8 changed files with 60 additions and 23 deletions

View file

@ -315,6 +315,23 @@ void curl_global_cleanup(void)
global_init_unlock();
}
/*
* curl_global_sslset() globally initializes the SSL backend to use.
*/
CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
const curl_ssl_backend ***avail)
{
CURLsslset rc;
global_init_lock();
rc = Curl_init_sslset_nolock(id, name, avail);
global_init_unlock();
return rc;
}
/*
* curl_easy_init() is the external interface to alloc, setup and init an
* easy handle that is returned. If anything goes wrong, NULL is returned.