From c92744d102a2d5fe5b88c84e073f7c4421d89953 Mon Sep 17 00:00:00 2001 From: Casey Langen Date: Sat, 24 Oct 2020 12:15:53 -0700 Subject: [PATCH] Let's use std::atomic<> instead of volatile. --- src/plugins/httpdatastream/HttpDataStream.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/httpdatastream/HttpDataStream.h b/src/plugins/httpdatastream/HttpDataStream.h index cab8b3429..0c55ad777 100755 --- a/src/plugins/httpdatastream/HttpDataStream.h +++ b/src/plugins/httpdatastream/HttpDataStream.h @@ -40,6 +40,7 @@ #include #include #include +#include using namespace musik::core::sdk; @@ -96,9 +97,9 @@ class HttpDataStream : public IDataStream { CURL* curlEasy; curl_slist *curlHeaders{ nullptr }; - volatile long written, totalWritten; - volatile bool interrupted; - volatile State state; + std::atomic written, totalWritten; + std::atomic interrupted; + std::atomic state; std::mutex stateMutex; std::condition_variable startedContition;