From ed4f2440a6e3b0f2cb46d417cb7a619bad722760 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 22 Oct 2020 00:06:42 -0700 Subject: [PATCH] Use an atomic variable for tracking instanceIds in HttpDataStream --- src/plugins/httpdatastream/HttpDataStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/httpdatastream/HttpDataStream.cpp b/src/plugins/httpdatastream/HttpDataStream.cpp index 1ebbcf899..b08978c25 100755 --- a/src/plugins/httpdatastream/HttpDataStream.cpp +++ b/src/plugins/httpdatastream/HttpDataStream.cpp @@ -51,6 +51,7 @@ #include #include #include +#include /* meh... */ #include <../../3rdparty/include/nlohmann/json.hpp> @@ -75,7 +76,7 @@ static IEnvironment* environment; static LruDiskCache diskCache; static std::string cachePath; static IPreferences* prefs; -static int64_t nextInstanceId = duration_cast(system_clock::now().time_since_epoch()).count(); +static std::atomic nextInstanceId = duration_cast(system_clock::now().time_since_epoch()).count(); static const int kDefaultMaxCacheFiles = 35; static const int kDefaultPreCacheSizeBytes = 524288; /*2^19 */