diff options
author | Thomas Guillem <thomas@gllm.fr> | 2022-04-05 16:00:37 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-06-07 13:34:03 +0200 |
commit | 2ed101256414ea5274e85e6f3d4c011b46442ac4 (patch) | |
tree | 361cc3fa90bd161cabba72fad9bdc8b1771954bf /include | |
parent | 23af112f5556d6a785c17e09f2422ac931405f61 (diff) | |
download | curl-2ed101256414ea5274e85e6f3d4c011b46442ac4.tar.gz |
curl_version_info: add CURL_VERSION_THREADSAFE_INIT
This flag can be used to make sure that curl_global_init() is
thread-safe.
This can be useful for libraries that can't control what other
dependencies are doing with Curl.
Closes #8680
Diffstat (limited to 'include')
-rw-r--r-- | include/curl/curl.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index cb26d24d5..13f01a017 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -2607,8 +2607,10 @@ CURL_EXTERN void curl_free(void *p); * * curl_global_init() should be invoked exactly once for each application that * uses libcurl and before any call of other libcurl functions. - * - * This function is not thread-safe! + + * This function is thread-safe if CURL_VERSION_THREADSAFE_INIT is set in the + * curl_version_info_data.features flag (fetch by curl_version_info()). + */ CURL_EXTERN CURLcode curl_global_init(long flags); @@ -3025,6 +3027,8 @@ typedef struct curl_version_info_data curl_version_info_data; #define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */ #define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */ #define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */ +#define CURL_VERSION_THREADSAFE_INIT (1<<30) /* curl_global_init/cleanup() are + thread-safe */ /* * NAME curl_version_info() |