From 2c1d2d2270c3c76ae436bb5f3f39e648118f09e7 Mon Sep 17 00:00:00 2001 From: Berenger Bramas <Berenger.Bramas@inria.fr> Date: Thu, 20 May 2021 09:00:35 +0200 Subject: [PATCH] Again try to make the intel compiler happy --- cpp/particles/lock_free_bool_array.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/particles/lock_free_bool_array.hpp b/cpp/particles/lock_free_bool_array.hpp index 699885aa..02819147 100644 --- a/cpp/particles/lock_free_bool_array.hpp +++ b/cpp/particles/lock_free_bool_array.hpp @@ -68,7 +68,11 @@ public: if(k->ownerId.load() != omp_get_thread_num()){ int localBusy = Busy;// Intel complains if we pass a const as last param int expected = Available; +#ifdef __INTEL_COMPILER + while(!__sync_val_compare_and_swap(&k->lock, &expected, localBusy)){ +#else while(!std::atomic_compare_exchange_strong(&k->lock, &expected, localBusy)){ +#endif usleep(1); expected = Available; } -- GitLab