From f1eede1106c710e498deea2640fb3981204408b3 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Tue, 13 Mar 2018 15:04:28 -0700 Subject: [PATCH] Track the last progress update with an atomic type, not volatile --- main.cpp | 2 +- main.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index af2fd23..5f2760f 100644 --- a/main.cpp +++ b/main.cpp @@ -68,7 +68,7 @@ static int min_detail = 7; int quiet = 0; int quiet_progress = 0; double progress_interval = 0; -volatile double last_progress = 0; +std::atomic last_progress(0); int geometry_scale = 0; double simplification = 1; size_t max_tile_size = 500000; diff --git a/main.hpp b/main.hpp index 7e3c647..9a74a92 100644 --- a/main.hpp +++ b/main.hpp @@ -2,6 +2,7 @@ #define MAIN_HPP #include +#include struct index { long long start = 0; @@ -23,7 +24,7 @@ extern int geometry_scale; extern int quiet; extern int quiet_progress; extern double progress_interval; -extern volatile double last_progress; +extern std::atomic last_progress; extern size_t CPUS; extern size_t TEMP_FILES;