You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2 threads can simultaneously set the values, or at least 1 simulaneous reader can read the value during the change of output function.
Proposal solution:
Use std::shared_mutex here. Use exclusive lock during modification and shared lock during the reading. This sure will consume some performance, but at least will be thread-safe.
The text was updated successfully, but these errors were encountered:
The call to the
trantor::Logger::setOutputFunction
is not thread safe:trantor/trantor/utils/Logger.h
Lines 124 to 139 in 8bf280b
2 threads can simultaneously set the values, or at least 1 simulaneous reader can read the value during the change of output function.
Proposal solution:
Use
std::shared_mutex
here. Use exclusive lock during modification and shared lock during the reading. This sure will consume some performance, but at least will be thread-safe.The text was updated successfully, but these errors were encountered: