cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Call curl_easy_cleanup from a different thread

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 5 Mar 2007 20:46:49 -0800

On Mon, Mar 05, 2007 at 02:26:01PM -0800, Matt Veenstra wrote:
> Can I call curl_easy_cleanup from the main thread after
> calling curl_easy_init from a separate thread?
>
> I don't call curl_easy_cleanup after each perform as I
> want to leave the connection open for faster operations.
>
> And I cant easily call back into a thread as I have thread
> wrappers that make this difficult. I really need to
> improve my wrappers to make this easier to do, but I don't
> quite have the time for rewriting these and if I could
> just close the curl handle in the main thread this would
> be super helpful.

I don't see why you couldn't. As long as you *guarantee* that the thread
will not be active in any curl call, it shouldn't matter which thread
actually calls curl_easy_cleanup.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-03-06