fix tsan errors on macOS when running the unittest

This commit is contained in:
Benjamin Sergeant
2019-09-23 21:51:55 -07:00
parent c32067013a
commit 733b414b3b
5 changed files with 36 additions and 46 deletions

View File

@ -205,6 +205,7 @@ static inline void fixNumericLocale(char* begin, char* end) {
#include <memory>
#include <set>
#include <limits>
#include <atomic>
#if defined(__BORLANDC__)
#include <stdio.h>
#endif
@ -227,8 +228,8 @@ static inline void fixNumericLocale(char* begin, char* end) {
#pragma warning(disable : 4996)
#endif
static int const stackLimit_g = 1000;
static int stackDepth_g = 0; // see readValue()
static std::atomic<int> const stackLimit_g(1000);
static std::atomic<int> stackDepth_g(0); // see readValue()
namespace Json {