curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: SSL and multithread crash on windows, how to use mutex on windows?

From: Thomas Glanzmann <thomas_at_glanzmann.de>
Date: Fri, 25 Nov 2016 07:25:43 +0100

Hello,

> SSL and multithread crash on windows, how to use mutex on windows?

Best way is you post a striped down example which crashes.

For me the following works, without a problem.

Once:
        curl_global_init(CURL_GLOBAL_DEFAULT);

For each thread:
        _beginthread(...);
        share = curl_share_init();
        curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
        curl = curl_easy_init();
        curl_easy_setopt(curl, CURLOPT_SHARE, share);
        curl_easy_setopt(curl, CURLOPT_URL, "https://google.com");
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);

Cheers,
        Thomas
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-11-25