#include <ShapeProcess_Context.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
+#include <Standard_Mutex.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <sys/stat.h>
-IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_Context,Standard_Transient)
+IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_Context, Standard_Transient)
+
+static Standard_Mutex THE_SHAPE_PROCESS_MUTEX;
//=======================================================================
//function : ShapeProcess_Context
Handle(Resource_Manager) ShapeProcess_Context::LoadResourceManager (const Standard_CString name)
{
+ Standard_Mutex::Sentry aLock(&THE_SHAPE_PROCESS_MUTEX);
// Optimisation of loading resource file: file is load only once
// and reloaded only if file date has changed
static Handle(Resource_Manager) sRC;
sUMtime = aUMtime;
}
}
- return sRC;
+ return new Resource_Manager(*sRC);
}
//=======================================================================
#include <XSAlgo_ToolContainer.hxx>
#include <TopExp_Explorer.hxx>
-IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
+IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer, Standard_Transient)
+
+static Standard_Mutex THE_RESOURCE_MUTEX;
//=======================================================================
//function : XSAlgo_AlgoContainer
}
// Define runtime tolerances and do Shape Processing
- rsc->SetResource ( "Runtime.Tolerance", Prec );
- rsc->SetResource ( "Runtime.MaxTolerance", maxTol );
-
+ {
+ Standard_Mutex::Sentry aLock(&THE_RESOURCE_MUTEX);
+ rsc->SetResource("Runtime.Tolerance", Prec);
+ rsc->SetResource("Runtime.MaxTolerance", maxTol);
+ }
if ( !ShapeProcess::Perform(context, seq, theProgress) )
return shape; // return original shape