From bd9a9ace4ae6da3e6600a58f79b1acb51edc831b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Nov 2016 16:44:45 +0100 Subject: 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. --- include/crow/http_connection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/crow/http_connection.h b/include/crow/http_connection.h index 96f2d14..7e0a9f3 100644 --- a/include/crow/http_connection.h +++ b/include/crow/http_connection.h @@ -176,7 +176,7 @@ namespace crow } #ifdef CROW_ENABLE_DEBUG - static int connectionCount; + static std::atomic connectionCount; #endif template class Connection -- cgit v1.2.3-54-g00ecf