Lines Matching refs:td
164 struct thread_data *td; /* for thread-self cleanup */ member
207 int init_thread_sync_data(struct thread_data *td, in init_thread_sync_data() argument
212 struct thread_sync_data *tsd = &td->tsd; in init_thread_sync_data()
216 tsd->td = td; in init_thread_sync_data()
297 struct thread_data *td = tsd->td; in getaddrinfo_thread() local
327 free(td); in getaddrinfo_thread()
365 struct thread_data *td = tsd->td; in gethostbyname_thread() local
380 free(td); in gethostbyname_thread()
398 struct thread_data *td = async->tdata; in destroy_async_data() local
401 curl_socket_t sock_rd = td->tsd.sock_pair[0]; in destroy_async_data()
402 struct Curl_easy *data = td->tsd.data; in destroy_async_data()
409 Curl_mutex_acquire(td->tsd.mtx); in destroy_async_data()
410 done = td->tsd.done; in destroy_async_data()
411 td->tsd.done = 1; in destroy_async_data()
412 Curl_mutex_release(td->tsd.mtx); in destroy_async_data()
415 Curl_thread_destroy(td->thread_hnd); in destroy_async_data()
418 if(td->thread_hnd != curl_thread_t_null) in destroy_async_data()
419 Curl_thread_join(&td->thread_hnd); in destroy_async_data()
421 destroy_thread_sync_data(&td->tsd); in destroy_async_data()
450 struct thread_data *td = calloc(1, sizeof(struct thread_data)); in init_resolve_thread() local
454 data->state.async.tdata = td; in init_resolve_thread()
455 if(!td) in init_resolve_thread()
462 td->thread_hnd = curl_thread_t_null; in init_resolve_thread()
464 if(!init_thread_sync_data(td, hostname, port, hints)) { in init_resolve_thread()
466 free(td); in init_resolve_thread()
476 td->tsd.done = 0; in init_resolve_thread()
479 td->thread_hnd = Curl_thread_create(getaddrinfo_thread, &td->tsd); in init_resolve_thread()
481 td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd); in init_resolve_thread()
484 if(td->thread_hnd == curl_thread_t_null) { in init_resolve_thread()
486 td->tsd.done = 1; in init_resolve_thread()
508 struct thread_data *td; in thread_wait_resolv() local
512 td = data->state.async.tdata; in thread_wait_resolv()
513 DEBUGASSERT(td); in thread_wait_resolv()
514 DEBUGASSERT(td->thread_hnd != curl_thread_t_null); in thread_wait_resolv()
517 if(Curl_thread_join(&td->thread_hnd)) { in thread_wait_resolv()
548 struct thread_data *td = data->state.async.tdata; in Curl_resolver_kill() local
553 if(td && td->thread_hnd != curl_thread_t_null in Curl_resolver_kill()
587 struct thread_data *td = data->state.async.tdata; in Curl_resolver_is_resolved() local
593 if(!td) { in Curl_resolver_is_resolved()
594 DEBUGASSERT(td); in Curl_resolver_is_resolved()
598 Curl_mutex_acquire(td->tsd.mtx); in Curl_resolver_is_resolved()
599 done = td->tsd.done; in Curl_resolver_is_resolved()
600 Curl_mutex_release(td->tsd.mtx); in Curl_resolver_is_resolved()
621 if(td->poll_interval == 0) in Curl_resolver_is_resolved()
623 td->poll_interval = 1; in Curl_resolver_is_resolved()
624 else if(elapsed >= td->interval_end) in Curl_resolver_is_resolved()
626 td->poll_interval *= 2; in Curl_resolver_is_resolved()
628 if(td->poll_interval > 250) in Curl_resolver_is_resolved()
629 td->poll_interval = 250; in Curl_resolver_is_resolved()
631 td->interval_end = elapsed + td->poll_interval; in Curl_resolver_is_resolved()
632 Curl_expire(data, td->poll_interval, EXPIRE_ASYNC_NAME); in Curl_resolver_is_resolved()
645 struct thread_data *td = data->state.async.tdata; in Curl_resolver_getsock() local
651 if(td) { in Curl_resolver_getsock()
653 socks[0] = td->tsd.sock_pair[0]; in Curl_resolver_getsock()
654 td->tsd.data = data; in Curl_resolver_getsock()