mirror of https://github.com/CGAL/cgal
Merge pull request #1421 from afabri/Nef_3-static-GF
Nef_3: Make variables atomic
This commit is contained in:
commit
2e4354f2e6
|
|
@ -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++;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue