Skip to content

Commit bf0b97d

Browse files
authored
Update curl_exception.h
Now traceback vector is completely thread safe.
1 parent f3c5499 commit bf0b97d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/curl_exception.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ namespace curl {
8888

8989
// Implementation of print_traceback
9090
inline void curl_exception::print_traceback() const {
91+
curl_exception::tracebackLocker.lock();
9192
std::for_each(curl_exception::traceback.begin(),curl_exception::traceback.end(),[](const curlcpp_traceback_object &value) {
9293
std::cout<<"ERROR: "<<value.first<<" ::::: FUNCTION: "<<value.second<<std::endl;
9394
});
95+
curl_exception::tracebackLocker.unlock();
9496
}
9597

9698
// Implementation of clear method.
@@ -187,4 +189,4 @@ namespace curl {
187189
};
188190
}
189191

190-
#endif /* defined(__curlcpp__curl_exception__) */
192+
#endif /* defined(__curlcpp__curl_exception__) */

0 commit comments

Comments
 (0)