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();
|
||||
|
||||
bool updateNeighboursImmediately = true;
|
||||
bool updateNeighboursImmediately = false;
|
||||
|
||||
if (left_tile.valid()) addNeighbour(left_tile.get());
|
||||
if (right_tile.valid()) addNeighbour(right_tile.get());
|
||||
|
@ -84,15 +84,21 @@ void Terrain::traverse(osg::NodeVisitor& nv)
|
||||
osgUtil::UpdateVisitor* uv = dynamic_cast<osgUtil::UpdateVisitor*>(&nv);
|
||||
if (uv)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
for(TerrainTileSet::iterator itr = _updateTerrainTileSet.begin();
|
||||
itr != _updateTerrainTileSet.end();
|
||||
typedef std::list< osg::ref_ptr<TerrainTile> > TerrainTileList;
|
||||
TerrainTileList tiles;
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
|
||||
std::copy(_updateTerrainTileSet.begin(), _updateTerrainTileSet.end(), std::back_inserter(tiles));
|
||||
_updateTerrainTileSet.clear();
|
||||
}
|
||||
|
||||
for(TerrainTileList::iterator itr = tiles.begin();
|
||||
itr != tiles.end();
|
||||
++itr)
|
||||
{
|
||||
TerrainTile* tile = *itr;
|
||||
tile->traverse(nv);
|
||||
}
|
||||
_updateTerrainTileSet.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user