All the other places where I used volatile but really wanted atomic

This commit is contained in:
Eric Fischer
2018-03-13 15:21:21 -07:00
parent f1eede1106
commit fac0ebbf52
6 changed files with 37 additions and 31 deletions
+3 -2
View File
@@ -4,6 +4,7 @@
#include <stddef.h>
#include <stdio.h>
#include <vector>
#include <atomic>
#include <sys/stat.h>
#include "geometry.hpp"
#include "mbtiles.hpp"
@@ -101,8 +102,8 @@ struct serialization_state {
const char *fname = NULL; // source file name
int line = 0; // user-oriented location within source for error reports
volatile long long *layer_seq = NULL; // sequence within current layer
volatile long long *progress_seq = NULL; // overall sequence for progress indicator
std::atomic<long long> *layer_seq = NULL; // sequence within current layer
std::atomic<long long> *progress_seq = NULL; // overall sequence for progress indicator
std::vector<struct reader> *readers = NULL; // array of data for each input thread
int segment = 0; // the current input thread