Track the last progress update with an atomic type, not volatile

This commit is contained in:
Eric Fischer 2018-03-13 15:04:28 -07:00
parent 834c05038c
commit f1eede1106
2 changed files with 3 additions and 2 deletions

View File

@ -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<double> last_progress(0);
int geometry_scale = 0;
double simplification = 1;
size_t max_tile_size = 500000;

View File

@ -2,6 +2,7 @@
#define MAIN_HPP
#include <stddef.h>
#include <atomic>
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<double> last_progress;
extern size_t CPUS;
extern size_t TEMP_FILES;