diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 10a1297ed01..9a68a2ea5b1 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -704,6 +704,21 @@ public: return success; } + bool is_element_locked_by_this_thread(Cell_handle cell_handle) const + { + bool locked = true; + 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()); + } + } + return locked; + } + Cell_handle inexact_locate(const Point& p, Cell_handle start, @@ -3281,6 +3296,16 @@ 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());