From 4fe9abcc0ece443e6ed30d875f922794d9608398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Thu, 17 Aug 2017 20:20:30 +0200 Subject: [PATCH] atomic workaround --- libsrc/meshing/meshclass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 1db47a41..f5414e35 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -350,10 +350,18 @@ namespace netgen */ // add lock-free to list + /* surfelements[sei].next = facedecoding[el.index-1].firstelement; auto & head = reinterpret_cast&> (facedecoding[el.index-1].firstelement); while (!head.compare_exchange_weak (surfelements[sei].next, sei)) ; + */ + surfelements[sei].next = facedecoding[el.index-1].firstelement; + auto & head = reinterpret_cast&> (facedecoding[el.index-1].firstelement); + auto & next = reinterpret_cast (surfelements[sei].next); + while (!head.compare_exchange_weak (next, sei)) + ; + /* if (SurfaceArea().Valid())