Merge pull request #3085 from afabri/Arrrangement_2-static_or_atomic-GF

Arrangement_2: Address all remaining points of issue #1384, but the renderer
This commit is contained in:
Sebastien Loriot 2018-05-16 08:46:18 +02:00 committed by GitHub
commit fe262d6215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -31,6 +31,7 @@
* The header file for the Arr_circle_segment_traits_2<Kenrel> class. * The header file for the Arr_circle_segment_traits_2<Kenrel> class.
*/ */
#include <CGAL/atomic.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h> #include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
@ -84,7 +85,11 @@ public:
/*! Get the next curve index. */ /*! Get the next curve index. */
static unsigned int get_index () static unsigned int get_index ()
{ {
static unsigned int index = 0; #ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
#endif
return (++index); return (++index);
} }

View File

@ -31,6 +31,7 @@
* The conic traits-class for the arrangement package. * The conic traits-class for the arrangement package.
*/ */
#include <CGAL/atomic.h>
#include <CGAL/tags.h> #include <CGAL/tags.h>
#include <CGAL/Arr_tags.h> #include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h> #include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
@ -114,7 +115,11 @@ public:
/*! Get the next conic index. */ /*! Get the next conic index. */
static unsigned int get_index () static unsigned int get_index ()
{ {
static unsigned int index = 0; #ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
#endif
return (++index); return (++index);
} }