asyn-thread: fix mutex refs and unused variable in no-HAVE_GETADDRINFO builds

Follow-up to 074048ae80 #16321
Follow-up to 2ee754d830 #16323
Closes #16370
This commit is contained in:
Viktor Szakats 2025-02-17 14:51:02 +01:00
parent 67559aa8ce
commit 80d93799a6
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -336,15 +336,15 @@ CURL_STDCALL gethostbyname_thread(void *arg)
tsd->sock_error = RESOLVER_ENOMEM;
}
Curl_mutex_acquire(tsd->mtx);
Curl_mutex_acquire(&tsd->mutx);
if(tsd->done) {
/* too late, gotta clean up the mess */
Curl_mutex_release(tsd->mtx);
Curl_mutex_release(&tsd->mutx);
destroy_thread_sync_data(tsd);
}
else {
tsd->done = TRUE;
Curl_mutex_release(tsd->mtx);
Curl_mutex_release(&tsd->mutx);
}
return 0;
@ -682,8 +682,6 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
int port,
int *waitp)
{
struct thread_data *td = &data->state.async.thdata;
*waitp = 0; /* default to synchronous response */
/* fire up a new resolver thread! */