New is_element_locked_by_this_thread for testing purposes

This commit is contained in:
Clement Jamin 2013-01-29 19:03:07 +01:00
parent b2afefab4b
commit ad4a9dcaf6
1 changed files with 25 additions and 0 deletions

View File

@ -704,6 +704,21 @@ public:
return success; 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 Cell_handle
inexact_locate(const Point& p, inexact_locate(const Point& p,
Cell_handle start, Cell_handle start,
@ -3281,6 +3296,16 @@ insert_in_conflict(const Point & p,
std::back_inserter(cells), std::back_inserter(cells),
Emptyset_iterator())); 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, // Remember the points that are hidden by the conflicting cells,
// as they will be deleted during the insertion. // as they will be deleted during the insertion.
hider.process_cells_in_conflict(cells.begin(), cells.end()); hider.process_cells_in_conflict(cells.begin(), cells.end());