Merge pull request #1421 from afabri/Nef_3-static-GF

Nef_3: Make variables atomic
This commit is contained in:
Laurent Rineau 2016-10-17 09:59:36 +02:00
commit 2e4354f2e6
1 changed files with 10 additions and 1 deletions

View File

@ -20,6 +20,9 @@
#ifndef CGAL_NEF_SNC_INDEXED_ITEMS_H
#define CGAL_NEF_SNC_INDEXED_ITEMS_H
#include <CGAL/atomic.h>
#include <CGAL/Nef_3/Vertex.h>
#include <CGAL/Nef_3/Halfedge.h>
#include <CGAL/Nef_3/Halffacet.h>
@ -39,7 +42,13 @@ class Index_generator {
public:
static int get_unique_index()
{
static int unique = 0;
// initialized with 0
// http://en.cppreference.com/w/cpp/language/zero_initialization
#ifdef CGAL_NO_ATOMIC
static int unique;
#else
static CGAL::cpp11::atomic<int> unique;
#endif
return unique++;
}
};