From 839e29b37ba4c36579e6a73ff150115e8177bd86 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 9 Jan 2020 11:23:30 +0100 Subject: [PATCH] Expand section about thread safety in documentation. --- include/mastodonpp.hpp | 8 ++++++++ src/curl_wrapper.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/include/mastodonpp.hpp b/include/mastodonpp.hpp index fec3ecf..11bde31 100644 --- a/include/mastodonpp.hpp +++ b/include/mastodonpp.hpp @@ -88,6 +88,14 @@ * (https://curl.haxx.se/libcurl/c/curl_global_cleanup.html) is called. Both * are not thread safe. * + * Do not make 2 requests with the same @link mastodonpp::Connection Connection + * @endlink at the same time. You can create as many @link + * mastodonpp::Connection Connection@endlink%s as you want from one @link + * mastodonpp::Instance Instance@endlink. + * + * If you are using libcurl with OpenSSL before 1.1.0, please read + * [libcurl-thread(3)](https://curl.haxx.se/libcurl/c/threadsafe.html). + * * @example example01_instance_info.cpp * @example example02_streaming.cpp */ diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp index 490af70..930e840 100644 --- a/src/curl_wrapper.cpp +++ b/src/curl_wrapper.cpp @@ -36,6 +36,7 @@ using std::atomic; using std::uint8_t; using std::uint16_t; +// No one will ever need more than 65535 connections. 😉 static atomic curlwrapper_instances{0}; CURLWrapper::CURLWrapper()