diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index d9ad3f15c2a..1cea3bd6965 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -703,6 +703,22 @@ public: return success; } + + template + bool is_point_locked_by_this_thread(const P3 &p) const + { + bool locked = true; +#ifdef CGAL_LINKED_WITH_TBB +# ifdef CGAL_MESH_3_LOCKING_STRATEGY_SIMPLE_GRID_LOCKING + Mesh_3::LockDataStructureType *p_lock_ds = Base::get_lock_data_structure(); + if (p_lock_ds) + { + locked = p_lock_ds->is_locked_by_this_thread(p); + } +# endif // CGAL_MESH_3_LOCKING_STRATEGY_SIMPLE_GRID_LOCKING +#endif // CGAL_LINKED_WITH_TBB + return locked; + } bool is_element_locked_by_this_thread(Cell_handle cell_handle) const { @@ -712,11 +728,7 @@ public: Mesh_3::LockDataStructureType *p_lock_ds = Base::get_lock_data_structure(); if (p_lock_ds) { - for (int iVertex = 0 ; locked && iVertex < 4 ; ++iVertex) - { - Vertex_handle vh = cell_handle->vertex(iVertex); - locked = p_lock_ds->is_locked_by_this_thread(vh->point()); - } + locked = p_lock_ds->is_tetrahedra_locked_by_this_thread(*cell_handle); } # endif // CGAL_MESH_3_LOCKING_STRATEGY_SIMPLE_GRID_LOCKING #endif // CGAL_LINKED_WITH_TBB @@ -3300,16 +3312,6 @@ insert_in_conflict(const Point & p, std::back_inserter(cells), Emptyset_iterator())); - // CJTODO TEST LOCK - for (Cell_handle ch : cells) - { - if (!is_element_locked_by_this_thread(ch)) - { - std::cerr << "************************ ARGH ****************" << std::endl; - int i = 0; - } - } - // Remember the points that are hidden by the conflicting cells, // as they will be deleted during the insertion. hider.process_cells_in_conflict(cells.begin(), cells.end()); diff --git a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h index e61ada1b5e7..66550ccbed7 100644 --- a/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_data_structure_3.h @@ -1280,7 +1280,7 @@ create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind2) n = cur->neighbor(zz); } // Now n is outside region, cur is inside. - + // CJTODO DATA RACE? n->tds_data().clear(); // Reset the flag for boundary cells. int jj1 = n->index(vj1); @@ -1339,7 +1339,7 @@ recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, n = cur->neighbor(zz); } // Now n is outside region, cur is inside. - + // CJTODO DATA RACE? n->tds_data().clear(); // Reset the flag for boundary cells. int jj1 = n->index(vj1); @@ -1404,7 +1404,7 @@ non_recursive_create_star_3(Vertex_handle v, Cell_handle c, int li, int prev_ind n = cur->neighbor(zz); } // Now n is outside region, cur is inside. - + // CJTODO DATA RACE? n->tds_data().clear(); // Reset the flag for boundary cells. int jj1 = n->index(vj1);