From b8a89437a1173d6f91edda57b645b2c30e5047a0 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 8 Sep 2016 18:40:08 +0100 Subject: [PATCH] Enable use of atomic store/load on clang. --- src/linkgraph/linkgraphjob.cpp | 2 +- src/linkgraph/linkgraphschedule.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linkgraph/linkgraphjob.cpp b/src/linkgraph/linkgraphjob.cpp index 368d42ae81..62a7aa3758 100644 --- a/src/linkgraph/linkgraphjob.cpp +++ b/src/linkgraph/linkgraphjob.cpp @@ -189,7 +189,7 @@ LinkGraphJob::~LinkGraphJob() */ bool LinkGraphJob::IsJobCompleted() const { -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) +#if defined(__GNUC__) || defined(__clang__) return __atomic_load_n(&job_completed, __ATOMIC_RELAXED); #else return job_completed; diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp index 7981202620..4d80629005 100644 --- a/src/linkgraph/linkgraphschedule.cpp +++ b/src/linkgraph/linkgraphschedule.cpp @@ -108,7 +108,7 @@ void LinkGraphSchedule::JoinNext() * This is just a hint variable to avoid performing the join excessively early and blocking the main thread. */ -#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) +#if defined(__GNUC__) || defined(__clang__) __atomic_store_n(&(job->job_completed), true, __ATOMIC_RELAXED); #else job->job_completed = true;