Fixed copy ctor of err_helper to be thread safe

This commit is contained in:
gabime
2025-01-17 18:35:34 +02:00
parent 62bbd87bdb
commit 80f00797e3
2 changed files with 11 additions and 7 deletions

View File

@@ -15,9 +15,10 @@ namespace details {
class SPDLOG_API err_helper {
err_handler custom_err_handler_;
std::chrono::steady_clock::time_point last_report_time_;
std::mutex mutex_;
mutable std::mutex mutex_;
public:
err_helper() = default;
~err_helper() = default;
err_helper(const err_helper& other);
err_helper(err_helper&& other) noexcept;
void handle_ex(const std::string& origin, const source_loc& loc, const std::exception& ex) noexcept;