cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re[2]: gethostbyname_thread: Access Violation

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 22 Aug 2005 13:49:08 +0200 (CEST)

On Mon, 22 Aug 2005, Igor Polyakov wrote:

> Curl_destroy_thread_data is called in my code from curl_easy_cleanup, I have
> checked it using breakpoint. td->thread_id within Curl_destroy_thread_data
> had value equal to the second thread id. I see that this function do some
> cleanup, but I feel it does not wait until second thread terminates...

I _think_ the problem is like this:

In lib/hostthre.c:Curl_getaddrinfo() a thread is created to do the resolving.
The thread is killed when the connection is disconnected.

*But* - and here comes the problem - there might be another resolve before the
connection is disconnected, and then a second thread is created without the
first one having been properly killed first.

Does this seem plausible? If so, perhaps we should make sure that the previous
thread is killed before we start a new one in the init_resolve_thread()
function?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-08-22