1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0023260: Regression: Instability in parallel incmesh on Linux.

Added protection to the function which may have data race (according to the valgrind report).
Added protection to the BRepMesh_FastDiscretFace::RestoreStructureFromTriangulation function
Slight reordering to optimize use of mutex (lock once)
Now Standard_Mutex::SentryNested are created as named object.
Map inside TopTools_MutexForShapeProvider now store Handle_TopoDS_TShape as a key instead of TopoDS_Shape
This commit is contained in:
dbv
2012-07-20 17:18:29 +04:00
parent 312cd1f500
commit f67d0512ac
4 changed files with 43 additions and 26 deletions

View File

@@ -21,17 +21,20 @@
#ifndef _TopTools_MutexForShapeProvider_HeaderFile
#define _TopTools_MutexForShapeProvider_HeaderFile
#include <Handle_TopoDS_TShape.hxx>
#include <NCollection_DataMap.hxx>
#include <Standard_Mutex.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ShapeMapHasher.hxx>
class Standard_Mutex;
class TopoDS_Shape;
//! Class TopTools_MutexForShapeProvider
//! This class is used to create and store mutexes associated with shapes.
class TopTools_MutexForShapeProvider
{
friend Standard_Boolean IsEqual(const Handle_TopoDS_TShape & theFirstHandle,
const Handle_TopoDS_TShape & theSecondHandle);
public:
//! Constructor
Standard_EXPORT TopTools_MutexForShapeProvider();
@@ -59,8 +62,14 @@ private:
TopTools_MutexForShapeProvider & operator = (const TopTools_MutexForShapeProvider &);
NCollection_DataMap<TopoDS_Shape, Standard_Mutex *, TopTools_ShapeMapHasher> myMap;
NCollection_DataMap<Handle_TopoDS_TShape, Standard_Mutex *> myMap;
};
inline Standard_Boolean IsEqual(const Handle_TopoDS_TShape & theFirstHandle,
const Handle_TopoDS_TShape & theSecondHandle)
{
return (theFirstHandle == theSecondHandle);
}
#endif