mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Use atomic type for connection count shared between threads
Even if this variable is only used in debug mode, it's still bad to have data races on it, as it was the case (and reported by thread sanitizer) before.
This commit is contained in:
parent
4e39b23e45
commit
bd9a9ace4a
@ -176,7 +176,7 @@ namespace crow
|
||||
}
|
||||
|
||||
#ifdef CROW_ENABLE_DEBUG
|
||||
static int connectionCount;
|
||||
static std::atomic<int> connectionCount;
|
||||
#endif
|
||||
template <typename Adaptor, typename Handler, typename ... Middlewares>
|
||||
class Connection
|
||||
|
Loading…
Reference in New Issue
Block a user