Skip to content

Commit

Permalink
Update curl_exception.h
Browse files Browse the repository at this point in the history
Now traceback vector is completely thread safe.
  • Loading branch information
JosephP91 committed Apr 22, 2017
1 parent f3c5499 commit bf0b97d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/curl_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ namespace curl {

// Implementation of print_traceback
inline void curl_exception::print_traceback() const {
curl_exception::tracebackLocker.lock();
std::for_each(curl_exception::traceback.begin(),curl_exception::traceback.end(),[](const curlcpp_traceback_object &value) {
std::cout<<"ERROR: "<<value.first<<" ::::: FUNCTION: "<<value.second<<std::endl;
});
curl_exception::tracebackLocker.unlock();
}

// Implementation of clear method.
Expand Down Expand Up @@ -187,4 +189,4 @@ namespace curl {
};
}

#endif /* defined(__curlcpp__curl_exception__) */
#endif /* defined(__curlcpp__curl_exception__) */

1 comment on commit bf0b97d

@JosephP91
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves #100

Please sign in to comment.