diff --git a/src/random.cpp b/src/random.cpp index aaf4db2d..7bc620d6 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -2,6 +2,7 @@ #include #include #include +#include namespace rack { @@ -12,7 +13,7 @@ namespace random { // from http://xoroshiro.di.unimi.it/xoroshiro128plus.c thread_local uint64_t xoroshiro128plus_state[2]; -static int threadCounter = 0; +static std::atomic threadCounter {0}; static uint64_t rotl(const uint64_t x, int k) { return (x << k) | (x >> (64 - k));