Re-organized the access of the mutex in Terrain to avoid deadlocks, and temporarily switched off the update of the neightbouring tile boundaries within the GeometryTechnique::generateGeometry method, again to avoid deadlocks.
This commit is contained in:
parent
d3527f3830
commit
80389a4a13
@ -903,7 +903,7 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca
|
|||||||
|
|
||||||
_neighbours.clear();
|
_neighbours.clear();
|
||||||
|
|
||||||
bool updateNeighboursImmediately = true;
|
bool updateNeighboursImmediately = false;
|
||||||
|
|
||||||
if (left_tile.valid()) addNeighbour(left_tile.get());
|
if (left_tile.valid()) addNeighbour(left_tile.get());
|
||||||
if (right_tile.valid()) addNeighbour(right_tile.get());
|
if (right_tile.valid()) addNeighbour(right_tile.get());
|
||||||
|
@ -83,16 +83,22 @@ void Terrain::traverse(osg::NodeVisitor& nv)
|
|||||||
// need to check if any TerrainTechniques need to have their update called on them.
|
// need to check if any TerrainTechniques need to have their update called on them.
|
||||||
osgUtil::UpdateVisitor* uv = dynamic_cast<osgUtil::UpdateVisitor*>(&nv);
|
osgUtil::UpdateVisitor* uv = dynamic_cast<osgUtil::UpdateVisitor*>(&nv);
|
||||||
if (uv)
|
if (uv)
|
||||||
|
{
|
||||||
|
typedef std::list< osg::ref_ptr<TerrainTile> > TerrainTileList;
|
||||||
|
TerrainTileList tiles;
|
||||||
{
|
{
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||||
for(TerrainTileSet::iterator itr = _updateTerrainTileSet.begin();
|
std::copy(_updateTerrainTileSet.begin(), _updateTerrainTileSet.end(), std::back_inserter(tiles));
|
||||||
itr != _updateTerrainTileSet.end();
|
_updateTerrainTileSet.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
for(TerrainTileList::iterator itr = tiles.begin();
|
||||||
|
itr != tiles.end();
|
||||||
++itr)
|
++itr)
|
||||||
{
|
{
|
||||||
TerrainTile* tile = *itr;
|
TerrainTile* tile = *itr;
|
||||||
tile->traverse(nv);
|
tile->traverse(nv);
|
||||||
}
|
}
|
||||||
_updateTerrainTileSet.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user