Fix data race in test case
This commit is contained in:
parent
2786558210
commit
ff62fe9e84
@ -1,2 +1,2 @@
|
|||||||
Change homebrew recipe to "brew install libomp" but not "brew install cryptopp"
|
Change homebrew recipe to "brew install libomp" but not "brew install cryptopp"
|
||||||
Change AppVeyor Badge to master branch
|
Change AppVeyor Badge to master branch
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#include "MinimalValueType.h"
|
#include "MinimalValueType.h"
|
||||||
|
|
||||||
int MinimalValueType::instances = 0;
|
std::atomic<int> MinimalValueType::instances(0);
|
||||||
|
@ -5,11 +5,12 @@
|
|||||||
#include <cpp-utils/macros.h>
|
#include <cpp-utils/macros.h>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cpp-utils/assert/assert.h>
|
#include <cpp-utils/assert/assert.h>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
// This is a not-default-constructible non-copyable but moveable Value type
|
// This is a not-default-constructible non-copyable but moveable Value type
|
||||||
class MinimalValueType {
|
class MinimalValueType {
|
||||||
public:
|
public:
|
||||||
static int instances;
|
static std::atomic<int> instances;
|
||||||
|
|
||||||
static MinimalValueType create(int value) {
|
static MinimalValueType create(int value) {
|
||||||
return MinimalValueType(value);
|
return MinimalValueType(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user