Fix g++ <= 4.9.2 CE.

GitOrigin-RevId: 8c1f56da7915989d0aaa2fe2f037558078d1efac
This commit is contained in:
levlam 2019-02-13 03:51:39 +03:00
parent 25018bdf12
commit 0063ebe1cc

View File

@ -19,7 +19,11 @@ class HazardPointers {
explicit HazardPointers(size_t threads_n) : threads_(threads_n) {
for (auto &data : threads_) {
for (auto &ptr : data.hazard) {
#if TD_GCC && GCC_VERSION <= 40902
ptr = nullptr;
#else
std::atomic_init(&ptr, static_cast<T *>(nullptr));
#endif
}
}
}