mirror of https://github.com/CGAL/cgal
Merge pull request #5692 from maxGimeno/CGAL_cpp11_atomic_and_threads-maxGimeno
CGAL:: Use std atomic and threads # Conflicts: # Arrangement_on_surface_2/include/CGAL/Arr_counting_traits_2.h
This commit is contained in:
commit
59a0da4f13
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
#include <CGAL/Apollonius_graph_2/basic.h>
|
||||
#include <CGAL/atomic.h>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -33,8 +33,8 @@ public:
|
|||
typedef bool bool_;
|
||||
typedef unsigned long long_;
|
||||
#else
|
||||
typedef CGAL::cpp11::atomic<bool> bool_;
|
||||
typedef CGAL::cpp11::atomic<unsigned long> long_;
|
||||
typedef std::atomic<bool> bool_;
|
||||
typedef std::atomic<unsigned long> long_;
|
||||
#endif
|
||||
|
||||
static bool_ count_cases;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
#include <CGAL/Apollonius_graph_2/basic.h>
|
||||
#include <CGAL/atomic.h>
|
||||
#include <atomic>
|
||||
|
||||
#define AG2_PROFILE_PREDICATES
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ public:
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
typedef unsigned long long_;
|
||||
#else
|
||||
typedef CGAL::cpp11::atomic<unsigned long> long_;
|
||||
typedef std::atomic<unsigned long> long_;
|
||||
#endif
|
||||
|
||||
// high level predicates
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@
|
|||
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
|
||||
*/
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static unsigned int index;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<unsigned int> index;
|
||||
static std::atomic<unsigned int> index;
|
||||
#endif
|
||||
return (++index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
*/
|
||||
|
||||
#include <fstream>
|
||||
#include <atomic>
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
|
||||
|
|
@ -108,7 +108,7 @@ public:
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static unsigned int index;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<unsigned int> index;
|
||||
static std::atomic<unsigned int> index;
|
||||
#endif
|
||||
return (++index);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include <iostream>
|
||||
#include <string.h>
|
||||
#include <atomic>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/Arr_enums.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
|
||||
|
|
@ -958,7 +958,7 @@ public:
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static size_t counter;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<size_t> counter;
|
||||
static std::atomic<size_t> counter;
|
||||
#endif
|
||||
if (doit) ++counter;
|
||||
return counter;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Bbox_3.h>
|
||||
#include <CGAL/Box_intersection_d/box_limits.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ struct Unique_numbers {
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static std::size_t n = 0;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<std::size_t> n; // initialized to 0
|
||||
static std::atomic<std::size_t> n; // initialized to 0
|
||||
#endif
|
||||
i = n++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@
|
|||
#define _CORE_COREDEFS_H_
|
||||
|
||||
#include <CGAL/CORE/extLong.h>
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#ifdef CGAL_HEADER_ONLY
|
||||
|
||||
#define CGAL_GLOBAL_STATE_VAR(TYPE, NAME, VALUE) \
|
||||
|
|
@ -75,7 +76,7 @@ namespace CORE {
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, AbortFlag, true)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, AbortFlag, true)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, AbortFlag, true)
|
||||
#endif
|
||||
|
||||
/// Invalid Flag -- initiallly value is non-negative
|
||||
|
|
@ -86,7 +87,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, AbortFlag, true)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(int, InvalidFlag, 0)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<int>, InvalidFlag, 0)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<int>, InvalidFlag, 0)
|
||||
#endif
|
||||
|
||||
/// Escape Precision in bits
|
||||
|
|
@ -102,7 +103,7 @@ CGAL_GLOBAL_STATE_VAR(long, EscapePrecFlag, 0)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, EscapePrecWarning, true)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, EscapePrecWarning, true)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, EscapePrecWarning, true)
|
||||
#endif
|
||||
|
||||
// These following two values determine the precision of computing
|
||||
|
|
@ -124,7 +125,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defAbsPrec, CORE_posInfty)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(long, defBigFloatOutputDigits, 10)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<long>, defBigFloatOutputDigits, 10)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<long>, defBigFloatOutputDigits, 10)
|
||||
#endif
|
||||
|
||||
/// default input precision in digits for converting a string to a Real or Expr
|
||||
|
|
@ -138,7 +139,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defInputDigits, CORE_posInfty)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(long, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits()
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<long>, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits()
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<long>, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits()
|
||||
#endif
|
||||
|
||||
/// default input precision in digits for converting a string to a BigFloat
|
||||
|
|
@ -146,7 +147,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<long>, defOutputDigits, 10) // == get_
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(long, defBigFloatInputDigits, 16)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<long>, defBigFloatInputDigits, 16)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<long>, defBigFloatInputDigits, 16)
|
||||
#endif
|
||||
|
||||
inline
|
||||
|
|
@ -169,7 +170,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defBFsqrtAbsPrec, 54)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, fpFilterFlag, true)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, fpFilterFlag, true)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, fpFilterFlag, true)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, fpFilterFlag, true)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, incrementalEvalFlag, true)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, incrementalEvalFlag, true)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, incrementalEvalFlag, true)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -185,7 +186,7 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, incrementalEvalFlag, true)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, progressiveEvalFlag, true)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, progressiveEvalFlag, true)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, progressiveEvalFlag, true)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -193,14 +194,14 @@ CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, progressiveEvalFlag, true)
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(bool, rationalReduceFlag, false)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<bool>, rationalReduceFlag, false)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<bool>, rationalReduceFlag, false)
|
||||
#endif
|
||||
|
||||
/// default initial (bit) precision for AddSub Progressive Evaluation
|
||||
#ifdef CGAL_NO_ATOMIC
|
||||
CGAL_GLOBAL_STATE_VAR(long, defInitialProgressivePrec, 64)
|
||||
#else
|
||||
CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic<long>, defInitialProgressivePrec, 64)
|
||||
CGAL_GLOBAL_STATE_VAR(std::atomic<long>, defInitialProgressivePrec, 64)
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#include "CGAL/CORE/CoreDefs.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace CORE {
|
||||
|
||||
// Default Values
|
||||
|
|
@ -50,7 +52,7 @@ int IOErrorFlag = 0;
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool AbortFlag = true;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> AbortFlag(true);
|
||||
std::atomic<bool> AbortFlag(true);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +63,7 @@ CGAL::cpp11::atomic<bool> AbortFlag(true);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
int InvalidFlag = 0;
|
||||
#else
|
||||
CGAL::cpp11::atomic<int> InvalidFlag(0);
|
||||
std::atomic<int> InvalidFlag(0);
|
||||
#endif
|
||||
|
||||
/* ************************************************************
|
||||
|
|
@ -97,7 +99,7 @@ long EscapePrecFlag = 0;
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool EscapePrecWarning = true;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> EscapePrecWarning(true);
|
||||
std::atomic<bool> EscapePrecWarning(true);
|
||||
#endif
|
||||
|
||||
/** The Composite Precision [defAbsPrec, defRelPrec]
|
||||
|
|
@ -117,7 +119,7 @@ extLong defRelPrec = 60;
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
long defBigFloatOutputDigits = 10;
|
||||
#else
|
||||
CGAL::cpp11::atomic<long> defBigFloatOutputDigits(10);
|
||||
std::atomic<long> defBigFloatOutputDigits(10);
|
||||
#endif
|
||||
|
||||
/** NORMALLY, we like to make this equal to defBigFloatOutputDigits
|
||||
|
|
@ -125,7 +127,7 @@ CGAL::cpp11::atomic<long> defBigFloatOutputDigits(10);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
long defOutputDigits = 10;
|
||||
#else
|
||||
CGAL::cpp11::atomic<long> defOutputDigits(10); // == defBigFloatOutputDigits;
|
||||
std::atomic<long> defOutputDigits(10); // == defBigFloatOutputDigits;
|
||||
#endif
|
||||
|
||||
/** String Input Precision */
|
||||
|
|
@ -142,7 +144,7 @@ extLong defInputDigits = CORE_posInfty;
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
long defBigFloatInputDigits = 16;
|
||||
#else
|
||||
CGAL::cpp11::atomic<long> defBigFloatInputDigits(16);
|
||||
std::atomic<long> defBigFloatInputDigits(16);
|
||||
#endif
|
||||
|
||||
/* ************************************************************
|
||||
|
|
@ -154,7 +156,7 @@ CGAL::cpp11::atomic<long> defBigFloatInputDigits(16);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool fpFilterFlag = true;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> fpFilterFlag(true);
|
||||
std::atomic<bool> fpFilterFlag(true);
|
||||
#endif
|
||||
|
||||
/** IncrementaL evaluation flag
|
||||
|
|
@ -163,7 +165,7 @@ CGAL::cpp11::atomic<bool> fpFilterFlag(true);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool incrementalEvalFlag = true;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> incrementalEvalFlag(true);
|
||||
std::atomic<bool> incrementalEvalFlag(true);
|
||||
#endif
|
||||
|
||||
/** Progressive evaluation flag
|
||||
|
|
@ -171,7 +173,7 @@ CGAL::cpp11::atomic<bool> incrementalEvalFlag(true);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool progressiveEvalFlag = true;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> progressiveEvalFlag(true);
|
||||
std::atomic<bool> progressiveEvalFlag(true);
|
||||
#endif
|
||||
|
||||
/** Initial progressive evaluation precision
|
||||
|
|
@ -179,7 +181,7 @@ CGAL::cpp11::atomic<bool> progressiveEvalFlag(true);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
long defInitialProgressivePrec = 64;
|
||||
#else
|
||||
CGAL::cpp11::atomic<long> defInitialProgressivePrec(64);
|
||||
std::atomic<long> defInitialProgressivePrec(64);
|
||||
#endif
|
||||
|
||||
/** RATIONAL REDUCTION FLAG
|
||||
|
|
@ -187,7 +189,7 @@ CGAL::cpp11::atomic<long> defInitialProgressivePrec(64);
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
bool rationalReduceFlag = false;
|
||||
#else
|
||||
CGAL::cpp11::atomic<bool> rationalReduceFlag(false);
|
||||
std::atomic<bool> rationalReduceFlag(false);
|
||||
#endif
|
||||
#endif // CGAL_HEADER_ONLY
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
#ifndef CGAL_ATOMIC_H
|
||||
#define CGAL_ATOMIC_H
|
||||
|
||||
#define CGAL_DEPRECATED_HEADER "<CGAL/atomic.h>"
|
||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/config.h>"
|
||||
|
||||
#include <CGAL/config.h>
|
||||
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
|
|
|
|||
|
|
@ -623,6 +623,9 @@ using std::max;
|
|||
# include <unordered_set>
|
||||
# include <unordered_map>
|
||||
# include <functional>
|
||||
# include <thread>
|
||||
# include <chrono>
|
||||
# include <atomic>
|
||||
//
|
||||
namespace CGAL {
|
||||
//
|
||||
|
|
@ -641,6 +644,16 @@ namespace CGAL {
|
|||
using std::is_enum;
|
||||
using std::unordered_set;
|
||||
using std::unordered_map;
|
||||
using std::atomic;
|
||||
using std::memory_order_relaxed;
|
||||
using std::memory_order_consume;
|
||||
using std::memory_order_acquire;
|
||||
using std::memory_order_release;
|
||||
using std::memory_order_acq_rel;
|
||||
using std::memory_order_seq_cst;
|
||||
using std::atomic_thread_fence;
|
||||
using std::thread;
|
||||
|
||||
}
|
||||
//
|
||||
namespace cpp0x = cpp11;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
#include <CGAL/Mesher_level_visitors.h>
|
||||
#include <CGAL/Kernel_traits.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#ifdef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE
|
||||
#include <CGAL/Surface_mesher/Surface_mesher_visitor.h>
|
||||
|
|
@ -65,6 +64,7 @@
|
|||
#include <boost/format.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Mesh_3 {
|
||||
|
|
@ -222,7 +222,7 @@ public:
|
|||
std::size_t maximal_number_of_vertices = 0,
|
||||
Mesh_error_code* error_code = 0
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr = 0
|
||||
, std::atomic<bool>* stop_ptr = 0
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ private:
|
|||
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
/// Pointer to the atomic Boolean that can stop the process
|
||||
CGAL::cpp11::atomic<bool>* const stop_ptr;
|
||||
std::atomic<bool>* const stop_ptr;
|
||||
#endif
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_TBB
|
||||
|
|
@ -318,7 +318,7 @@ private:
|
|||
bool forced_stop() const {
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(stop_ptr != 0 &&
|
||||
stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
stop_ptr->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
if(error_code_ != 0) *error_code_ = CGAL_MESH_3_STOPPED;
|
||||
return true;
|
||||
|
|
@ -353,7 +353,7 @@ Mesher_3<C3T3,MC,MD>::Mesher_3(C3T3& c3t3,
|
|||
std::size_t maximal_number_of_vertices,
|
||||
Mesh_error_code* error_code
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Base(c3t3.bbox(),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include <CGAL/Mesh_3/Profiling_tools.h>
|
||||
#endif
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/Mesh_3/Worksharing_data_structures.h>
|
||||
|
||||
#ifdef CGAL_CONCURRENT_MESH_3_PROFILING
|
||||
|
|
@ -37,7 +36,7 @@
|
|||
# include <tbb/task_group.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL { namespace Mesh_3 {
|
||||
|
||||
|
|
@ -677,7 +676,7 @@ public:
|
|||
void set_lock_ds(Lock_data_structure *) {}
|
||||
void set_worksharing_ds(WorksharingDataStructureType *) {}
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
void set_stop_pointer(CGAL::cpp11::atomic<bool>*) {}
|
||||
void set_stop_pointer(std::atomic<bool>*) {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
|
@ -1147,7 +1146,7 @@ public:
|
|||
}
|
||||
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
void set_stop_pointer(CGAL::cpp11::atomic<bool>* stop_ptr)
|
||||
void set_stop_pointer(std::atomic<bool>* stop_ptr)
|
||||
{
|
||||
m_stop_ptr = stop_ptr;
|
||||
}
|
||||
|
|
@ -1156,7 +1155,7 @@ public:
|
|||
bool forced_stop() const {
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(m_stop_ptr != 0 &&
|
||||
m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
m_stop_ptr->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
CGAL_assertion(m_task_group != 0);
|
||||
m_task_group->cancel();
|
||||
|
|
@ -1177,7 +1176,7 @@ protected:
|
|||
|
||||
tbb::task_group *m_task_group;
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
CGAL::cpp11::atomic<bool>* m_stop_ptr;
|
||||
std::atomic<bool>* m_stop_ptr;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Delaunay_triangulation_3.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
|
||||
|
|
@ -70,6 +69,7 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Mesh_3 {
|
||||
|
|
@ -143,7 +143,7 @@ public:
|
|||
std::size_t maximal_number_of_vertices = 0,
|
||||
Mesh_error_code* error_code = 0
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr = 0
|
||||
, std::atomic<bool>* stop_ptr = 0
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ public:
|
|||
bool forced_stop() const {
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(stop_ptr_ != 0 &&
|
||||
stop_ptr_->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
stop_ptr_->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
if(error_code_ != 0) *error_code_ = CGAL_MESH_3_STOPPED;
|
||||
return true;
|
||||
|
|
@ -469,7 +469,7 @@ private:
|
|||
Mesh_error_code* const error_code_;
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
/// Pointer to the atomic Boolean that can stop the process
|
||||
CGAL::cpp11::atomic<bool>* const stop_ptr_;
|
||||
std::atomic<bool>* const stop_ptr_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ Protect_edges_sizing_field(C3T3& c3t3, const MD& domain,
|
|||
std::size_t maximal_number_of_vertices,
|
||||
Mesh_error_code* error_code
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: c3t3_(c3t3)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <tbb/blocked_range.h>
|
||||
#include <tbb/parallel_for.h>
|
||||
#endif
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <CGAL/Meshes/Filtered_deque_container.h>
|
||||
#include <CGAL/Meshes/Filtered_multimap_container.h>
|
||||
|
|
@ -41,7 +40,7 @@
|
|||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <sstream>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -319,7 +318,7 @@ public:
|
|||
C3T3& c3t3,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
);
|
||||
// For parallel
|
||||
|
|
@ -332,7 +331,7 @@ public:
|
|||
WorksharingDataStructureType *worksharing_ds,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
@ -372,7 +371,7 @@ public:
|
|||
{
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(m_stop_ptr != 0 &&
|
||||
m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
m_stop_ptr->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -573,7 +572,7 @@ private:
|
|||
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
/// Pointer to the atomic Boolean that can stop the process
|
||||
CGAL::cpp11::atomic<bool>* const m_stop_ptr;
|
||||
std::atomic<bool>* const m_stop_ptr;
|
||||
#endif
|
||||
private:
|
||||
// Disabled copy constructor
|
||||
|
|
@ -595,7 +594,7 @@ Refine_cells_3(Tr& triangulation,
|
|||
C3T3& c3t3,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Mesher_level<Tr, Self, Cell_handle, P_,
|
||||
|
|
@ -628,7 +627,7 @@ Refine_cells_3(Tr& triangulation,
|
|||
WorksharingDataStructureType *worksharing_ds,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Mesher_level<Tr, Self, Cell_handle, P_,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@
|
|||
#include <CGAL/Mesh_3/Dump_c3t3.h>
|
||||
|
||||
#include <CGAL/Object.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
|
@ -51,6 +50,7 @@
|
|||
#include <CGAL/tuple.h>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <sstream>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ public:
|
|||
const Criteria& criteria,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: r_tr_(tr)
|
||||
|
|
@ -275,7 +275,7 @@ public:
|
|||
{
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(m_stop_ptr != 0 &&
|
||||
m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
m_stop_ptr->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -615,7 +615,7 @@ protected:
|
|||
std::size_t m_maximal_number_of_vertices_;
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
/// Pointer to the atomic Boolean that can stop the process
|
||||
CGAL::cpp11::atomic<bool>* const m_stop_ptr;
|
||||
std::atomic<bool>* const m_stop_ptr;
|
||||
#endif
|
||||
}; // end class template Refine_facets_3_base
|
||||
|
||||
|
|
@ -783,7 +783,7 @@ public:
|
|||
int mesh_topology,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
);
|
||||
// For parallel
|
||||
|
|
@ -796,7 +796,7 @@ public:
|
|||
WorksharingDataStructureType *worksharing_ds,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
@ -916,7 +916,7 @@ Refine_facets_3(Tr& triangulation,
|
|||
int mesh_topology,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Rf_base(triangulation, c3t3, oracle, criteria, mesh_topology,
|
||||
|
|
@ -945,7 +945,7 @@ Refine_facets_3(Tr& triangulation,
|
|||
WorksharingDataStructureType *worksharing_ds,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Rf_base(triangulation, c3t3, oracle, criteria, maximal_number_of_vertices
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include <CGAL/Mesh_facet_topology.h>
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/utility.h>
|
||||
#include <CGAL/Time_stamper.h>
|
||||
|
||||
|
|
@ -31,6 +30,7 @@
|
|||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ public:
|
|||
int mesh_topology,
|
||||
std::size_t maximal_number_of_vertices
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* stop_ptr
|
||||
, std::atomic<bool>* stop_ptr
|
||||
#endif
|
||||
)
|
||||
: Base(triangulation,
|
||||
|
|
@ -446,7 +446,7 @@ public:
|
|||
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
if(this->m_stop_ptr != 0 &&
|
||||
this->m_stop_ptr->load(CGAL::cpp11::memory_order_acquire) == true)
|
||||
this->m_stop_ptr->load(std::memory_order_acquire) == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <CGAL/Mesh_3/io_signature.h>
|
||||
#include <CGAL/Has_timestamp.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -65,6 +66,13 @@ template <>
|
|||
class Mesh_vertex_base_3_base<Parallel_tag>
|
||||
{
|
||||
public:
|
||||
Mesh_vertex_base_3_base()
|
||||
{}
|
||||
|
||||
Mesh_vertex_base_3_base( const Mesh_vertex_base_3_base& c)
|
||||
{
|
||||
m_erase_counter.store(c.erase_counter());
|
||||
}
|
||||
|
||||
// Erase counter (cf. Compact_container)
|
||||
unsigned int erase_counter() const
|
||||
|
|
@ -81,7 +89,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
typedef tbb::atomic<unsigned int> Erase_counter_type;
|
||||
typedef std::atomic<unsigned int> Erase_counter_type;
|
||||
Erase_counter_type m_erase_counter;
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace parameters {
|
||||
|
|
@ -192,7 +194,7 @@ void init_c3t3_with_features(C3T3& c3t3,
|
|||
std::size_t maximal_number_of_vertices = 0,
|
||||
Mesh_error_code* pointer_to_error_code = 0
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
, CGAL::cpp11::atomic<bool>* pointer_to_stop = 0
|
||||
, std::atomic<bool>* pointer_to_stop = 0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@
|
|||
#include <CGAL/Mesh_3/Mesher_3.h>
|
||||
#include <CGAL/Mesh_error_code.h>
|
||||
#include <CGAL/optimize_mesh_3.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace details {
|
||||
|
|
@ -196,7 +197,7 @@ struct Manifold_options {
|
|||
// Various Mesh_3 option
|
||||
struct Mesh_3_options {
|
||||
#ifndef CGAL_NO_ATOMIC
|
||||
typedef CGAL::cpp11::atomic<bool>* Pointer_to_stop_atomic_boolean_t;
|
||||
typedef std::atomic<bool>* Pointer_to_stop_atomic_boolean_t;
|
||||
#else
|
||||
typedef bool* Pointer_to_stop_atomic_boolean_t;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@
|
|||
|
||||
#include <CGAL/license/Nef_3.h>
|
||||
|
||||
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <CGAL/Nef_3/Vertex.h>
|
||||
#include <CGAL/Nef_3/Halfedge.h>
|
||||
#include <CGAL/Nef_3/Halffacet.h>
|
||||
|
|
@ -26,6 +23,8 @@
|
|||
#include <CGAL/Nef_3/SHalfloop.h>
|
||||
#include <CGAL/Nef_3/SFace.h>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#undef CGAL_NEF_DEBUG
|
||||
#define CGAL_NEF_DEBUG 83
|
||||
#include <CGAL/Nef_2/debug.h>
|
||||
|
|
@ -42,7 +41,7 @@ class Index_generator {
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static int unique;
|
||||
#else
|
||||
static CGAL::cpp11::atomic<int> unique;
|
||||
static std::atomic<int> unique;
|
||||
#endif
|
||||
return unique++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
#define CGAL_COUNTED_NUMBER_H
|
||||
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/atomic.h>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp> // for Root_of_selector
|
||||
#include <iostream>
|
||||
#include <atomic>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class Counted_number {
|
|||
#ifdef CGAL_NO_ATOMIC
|
||||
static unsigned long
|
||||
#else
|
||||
static CGAL::cpp11::atomic<unsigned long>
|
||||
static std::atomic<unsigned long>
|
||||
#endif
|
||||
s_neg_count, s_add_count, s_sub_count,
|
||||
s_mul_count, s_div_count,
|
||||
|
|
@ -280,64 +280,64 @@ template< class NT >
|
|||
unsigned long Counted_number<NT>::s_mod_count = 0;
|
||||
#else
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_neg_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_neg_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_add_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_add_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_sub_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_sub_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_mul_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_mul_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_div_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_div_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_eq_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_eq_count;
|
||||
|
||||
template <class NT>
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_comp_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_comp_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_simplify_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_simplify_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_unit_part_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_unit_part_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_is_zero_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_is_zero_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_is_one_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_is_one_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_square_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_square_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_integral_division_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_integral_division_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_is_square_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_is_square_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_sqrt_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_sqrt_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_kth_root_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_kth_root_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_root_of_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_root_of_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_gcd_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_gcd_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_div_mod_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_div_mod_count;
|
||||
|
||||
template< class NT >
|
||||
CGAL::cpp11::atomic<unsigned long> Counted_number<NT>::s_mod_count;
|
||||
std::atomic<unsigned long> Counted_number<NT>::s_mod_count;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
#define CGAL_PSP_INTERNAL_CALLBACK_WRAPPER_H
|
||||
|
||||
#include <CGAL/license/Point_set_processing_3.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
#include <CGAL/thread.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Point_set_processing_3 {
|
||||
|
|
@ -91,11 +91,11 @@ template <>
|
|||
class Callback_wrapper<CGAL::Parallel_tag>
|
||||
{
|
||||
const std::function<bool(double)>& m_callback;
|
||||
cpp11::atomic<std::size_t>* m_advancement;
|
||||
cpp11::atomic<bool>* m_interrupted;
|
||||
std::atomic<std::size_t>* m_advancement;
|
||||
std::atomic<bool>* m_interrupted;
|
||||
std::size_t m_size;
|
||||
bool m_creator;
|
||||
cpp11::thread* m_thread;
|
||||
std::thread* m_thread;
|
||||
|
||||
// assignment operator shouldn't be used (m_callback is const ref)
|
||||
Callback_wrapper& operator= (const Callback_wrapper&)
|
||||
|
|
@ -109,17 +109,17 @@ public:
|
|||
std::size_t advancement = 0,
|
||||
bool interrupted = false)
|
||||
: m_callback (callback)
|
||||
, m_advancement (new cpp11::atomic<std::size_t>())
|
||||
, m_interrupted (new cpp11::atomic<bool>())
|
||||
, m_advancement (new std::atomic<std::size_t>())
|
||||
, m_interrupted (new std::atomic<bool>())
|
||||
, m_size (size)
|
||||
, m_creator (true)
|
||||
, m_thread (nullptr)
|
||||
{
|
||||
// cpp11::atomic only has default constructor, initialization done in two steps
|
||||
// std::atomic only has default constructor, initialization done in two steps
|
||||
*m_advancement = advancement;
|
||||
*m_interrupted = interrupted;
|
||||
if (m_callback)
|
||||
m_thread = new cpp11::thread (*this);
|
||||
m_thread = new std::thread (*this);
|
||||
}
|
||||
|
||||
Callback_wrapper (const Callback_wrapper& other)
|
||||
|
|
@ -150,11 +150,11 @@ public:
|
|||
*m_advancement = advancement;
|
||||
*m_interrupted = interrupted;
|
||||
if (m_callback)
|
||||
m_thread = new cpp11::thread (*this);
|
||||
m_thread = new std::thread (*this);
|
||||
}
|
||||
|
||||
cpp11::atomic<std::size_t>& advancement() { return *m_advancement; }
|
||||
cpp11::atomic<bool>& interrupted() { return *m_interrupted; }
|
||||
std::atomic<std::size_t>& advancement() { return *m_advancement; }
|
||||
std::atomic<bool>& interrupted() { return *m_interrupted; }
|
||||
void join()
|
||||
{
|
||||
if (m_thread != nullptr)
|
||||
|
|
@ -169,7 +169,9 @@ public:
|
|||
*m_interrupted = true;
|
||||
if (*m_interrupted)
|
||||
return;
|
||||
cpp11::sleep_for (0.00001);
|
||||
typedef std::chrono::nanoseconds nanoseconds;
|
||||
nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.00001));
|
||||
std::this_thread::sleep_for(ns);
|
||||
}
|
||||
if (m_callback)
|
||||
m_callback (1.);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include <QProgressDialog>
|
||||
#include <CGAL/Real_timer.h>
|
||||
#include <CGAL/thread.h>
|
||||
|
||||
#include "Callback_signaler.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
typedef CGAL::Parallel_if_available_tag Concurrency_tag;
|
||||
|
||||
class Signal_callback
|
||||
|
|
@ -112,12 +113,14 @@ void run_with_qprogressdialog (Functor& functor,
|
|||
#ifdef CGAL_HAS_STD_THREADS
|
||||
if (boost::is_convertible<ConcurrencyTag, CGAL::Parallel_tag>::value)
|
||||
{
|
||||
CGAL::cpp11::thread thread (functor);
|
||||
std::thread thread (functor);
|
||||
|
||||
while (*signal_callback->latest_adv != 1. &&
|
||||
*signal_callback->state)
|
||||
{
|
||||
CGAL::cpp11::sleep_for (0.1);
|
||||
typedef std::chrono::nanoseconds nanoseconds;
|
||||
nanoseconds ns (nanoseconds::rep (1000000000.0 * 0.1));
|
||||
std::this_thread::sleep_for(ns);
|
||||
QApplication::processEvents ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <atomic>
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
|
|
@ -92,7 +93,7 @@ struct Profile_counter
|
|||
Profile_counter(const std::string & ss)
|
||||
: s(ss)
|
||||
{
|
||||
i = 0; // needed here because of tbb::atomic
|
||||
i = 0; // needed here because of std::atomic
|
||||
}
|
||||
|
||||
void operator++() { ++i; }
|
||||
|
|
@ -107,7 +108,7 @@ struct Profile_counter
|
|||
|
||||
private:
|
||||
#ifdef CGAL_CONCURRENT_PROFILE
|
||||
tbb::atomic<unsigned int> i;
|
||||
std::atomic<unsigned int> i;
|
||||
#else
|
||||
unsigned int i;
|
||||
#endif
|
||||
|
|
@ -167,7 +168,7 @@ struct Profile_branch_counter
|
|||
Profile_branch_counter(const std::string & ss)
|
||||
: s(ss)
|
||||
{
|
||||
i = j = 0; // needed here because of tbb::atomic
|
||||
i = j = 0; // needed here because of std::atomic
|
||||
}
|
||||
|
||||
void operator++() { ++i; }
|
||||
|
|
@ -183,7 +184,7 @@ struct Profile_branch_counter
|
|||
|
||||
private:
|
||||
#ifdef CGAL_CONCURRENT_PROFILE
|
||||
tbb::atomic<unsigned int> i, j;
|
||||
std::atomic<unsigned int> i, j;
|
||||
#else
|
||||
unsigned int i, j;
|
||||
#endif
|
||||
|
|
@ -196,7 +197,7 @@ struct Profile_branch_counter_3
|
|||
Profile_branch_counter_3(const std::string & ss)
|
||||
: s(ss)
|
||||
{
|
||||
i = j = k = 0; // needed here because of tbb::atomic
|
||||
i = j = k = 0; // needed here because of std::atomic
|
||||
}
|
||||
|
||||
void operator++() { ++i; }
|
||||
|
|
@ -214,7 +215,7 @@ struct Profile_branch_counter_3
|
|||
|
||||
private:
|
||||
#ifdef CGAL_CONCURRENT_PROFILE
|
||||
tbb::atomic<unsigned int> i, j, k;
|
||||
std::atomic<unsigned int> i, j, k;
|
||||
#else
|
||||
unsigned int i, j, k;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/CC_safe_handle.h>
|
||||
#include <CGAL/Time_stamper.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <tbb/enumerable_thread_specific.h>
|
||||
#include <tbb/queuing_mutex.h>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
#define CGAL_TIME_STAMPER_H
|
||||
|
||||
#include <CGAL/Has_timestamp.h>
|
||||
#include <CGAL/atomic.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
#ifndef CGAL_THREAD_H
|
||||
#define CGAL_THREAD_H
|
||||
|
||||
#define CGAL_DEPRECATED_HEADER "<CGAL/thread.h>"
|
||||
#define CGAL_REPLACEMENT_HEADER "<CGAL/config.h>"
|
||||
|
||||
#include <CGAL/config.h>
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue