From e6b33376bbdebee5a02c353ed013d23fcee256e6 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 29 Mar 2013 17:16:26 +0100 Subject: [PATCH] Avoid multiple calls to tbb::enumerable_thread_specific::local() --- Triangulation_3/include/CGAL/Delaunay_triangulation_3.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 99155505d41..7fd5f3264bd 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -305,6 +305,7 @@ public: tbb::blocked_range( i, num_points ), [&] (const tbb::blocked_range& r) { + Vertex_handle &hint = tls_hint.local(); for( size_t i_point = r.begin() ; i_point != r.end() ; ++i_point) { //std::stringstream sstr; @@ -313,15 +314,15 @@ public: bool success = false; while(!success) { - if (try_lock_vertex(tls_hint.local()) && try_lock_point(points[i_point])) + if (try_lock_vertex(hint) && try_lock_point(points[i_point])) { bool could_lock_zone; Vertex_handle new_hint = insert( - points[i_point], tls_hint.local(), &could_lock_zone); + points[i_point], hint, &could_lock_zone); if (could_lock_zone) { - tls_hint.local() = new_hint; + hint = new_hint; success = true; #ifdef CGAL_CONCURRENT_TRIANGULATION_3_PROFILING ++bcounter;