summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/curl_threads.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2025-06-04 09:49:23 +0300
committerdartraiden <wowemuh@gmail.com>2025-06-04 10:27:11 +0300
commit86d1a677fd310d7d90d6f7545c02a4bd68e1d955 (patch)
tree7fd5f46ef18038d10dcdf9fa19ffee547d51d6ad /libs/libcurl/src/curl_threads.c
parente8e2a816fbbcec0d6a64496928fecff19c281d82 (diff)
libcurl: update to 8.14.0
Diffstat (limited to 'libs/libcurl/src/curl_threads.c')
-rw-r--r--libs/libcurl/src/curl_threads.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libs/libcurl/src/curl_threads.c b/libs/libcurl/src/curl_threads.c
index caee0a6df9..c4831471d6 100644
--- a/libs/libcurl/src/curl_threads.c
+++ b/libs/libcurl/src/curl_threads.c
@@ -35,9 +35,7 @@
#endif
#include "curl_threads.h"
-#ifdef BUILDING_LIBCURL
#include "curl_memory.h"
-#endif
/* The last #include file should be: */
#include "memdebug.h"
@@ -82,11 +80,12 @@ err:
return curl_thread_t_null;
}
-void Curl_thread_destroy(curl_thread_t hnd)
+void Curl_thread_destroy(curl_thread_t *hnd)
{
- if(hnd != curl_thread_t_null) {
- pthread_detach(*hnd);
- free(hnd);
+ if(*hnd != curl_thread_t_null) {
+ pthread_detach(**hnd);
+ free(*hnd);
+ *hnd = curl_thread_t_null;
}
}
@@ -138,10 +137,12 @@ curl_thread_t Curl_thread_create(
return t;
}
-void Curl_thread_destroy(curl_thread_t hnd)
+void Curl_thread_destroy(curl_thread_t *hnd)
{
- if(hnd != curl_thread_t_null)
- CloseHandle(hnd);
+ if(*hnd != curl_thread_t_null) {
+ CloseHandle(*hnd);
+ *hnd = curl_thread_t_null;
+ }
}
int Curl_thread_join(curl_thread_t *hnd)
@@ -153,9 +154,7 @@ int Curl_thread_join(curl_thread_t *hnd)
int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0);
#endif
- Curl_thread_destroy(*hnd);
-
- *hnd = curl_thread_t_null;
+ Curl_thread_destroy(hnd);
return ret;
}