From 0cbf41493cee2b9bd598557b97df9b1211da2b9d Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 30 Jan 2020 18:04:20 +0100 Subject: Use mutex from stl instead of tbb one that is deprecated --- src/Nerve_GIC/include/gudhi/GIC.h | 8 ++++---- src/Tangential_complex/include/gudhi/Tangential_complex.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index a47d6889..2a6d4788 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -14,7 +14,7 @@ #ifdef GUDHI_USE_TBB #include -#include +#include #endif #include @@ -459,7 +459,7 @@ class Cover_complex { // This cannot be parallelized if thread_local is not defined // thread_local is not defined for XCode < v.8 #if defined(GUDHI_USE_TBB) && defined(GUDHI_CAN_USE_CXX11_THREAD_LOCAL) - tbb::mutex deltamutex; + std::mutex deltamutex; tbb::parallel_for(0, N, [&](int i){ std::vector samples(m); SampleWithoutReplacement(n, m, samples); @@ -765,7 +765,7 @@ class Cover_complex { #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing connected components (parallelized)..." << std::endl; - tbb::mutex covermutex, idmutex; + std::mutex covermutex, idmutex; tbb::parallel_for(0, res, [&](int i){ // Compute connected components Graph G = one_skeleton.create_subgraph(); @@ -895,7 +895,7 @@ class Cover_complex { // Compute the geodesic distances to subsamples with Dijkstra #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing geodesic distances (parallelized)..." << std::endl; - tbb::mutex coverMutex; tbb::mutex mindistMutex; + std::mutex coverMutex; std::mutex mindistMutex; tbb::parallel_for(0, m, [&](int i){ int seed = voronoi_subsamples[i]; std::vector dmap(n); diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index f058fa9f..f007bdd5 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -60,7 +60,7 @@ #ifdef GUDHI_USE_TBB #include #include -#include +#include #endif // #define GUDHI_TC_EXPORT_NORMALS // Only for 3D surfaces (k=2, d=3) @@ -147,7 +147,7 @@ class Tangential_complex { typedef typename Tr_traits::Vector_d Tr_vector; #if defined(GUDHI_USE_TBB) - typedef tbb::mutex Mutex_for_perturb; + typedef std::mutex Mutex_for_perturb; typedef Vector Translation_for_perturb; typedef std::vector > Weights; #else -- cgit v1.2.3