From: aka Date: Thu, 24 Aug 2017 11:30:23 +0000 (+0300) Subject: Mutex for some static init functions X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=4f90ff1f516ea840f8abaaf2982cfcb54d11c08e;p=occt-copy.git Mutex for some static init functions --- diff --git a/src/Message/Message_MsgFile.cxx b/src/Message/Message_MsgFile.cxx index 123822d3d9..20e6d4791b 100644 --- a/src/Message/Message_MsgFile.cxx +++ b/src/Message/Message_MsgFile.cxx @@ -277,6 +277,7 @@ Standard_Boolean Message_MsgFile::LoadFromEnv (const Standard_CString theEnvName const Standard_CString theFileName, const Standard_CString theLangExt) { + Standard_Mutex::Sentry aSentry(theMutex); TCollection_AsciiString aLangExt (theLangExt != NULL ? theLangExt : ""); if (aLangExt.IsEmpty()) { diff --git a/src/STEPControl/STEPControl_Controller.cxx b/src/STEPControl/STEPControl_Controller.cxx index c8315b3977..ab60b0e272 100644 --- a/src/STEPControl/STEPControl_Controller.cxx +++ b/src/STEPControl/STEPControl_Controller.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -62,10 +63,14 @@ IMPLEMENT_STANDARD_RTTIEXT(STEPControl_Controller,XSControl_Controller) STEPControl_Controller::STEPControl_Controller() : XSControl_Controller("STEP", "step") { - RWHeaderSection::Init(); - myAdaptorProtocol = new StepAP214_Protocol(); - RWStepAP214::Init(Handle(StepAP214_Protocol)::DownCast(myAdaptorProtocol)); + + static Standard_Mutex aPars; + { + Standard_Mutex::Sentry aLock(aPars); + RWHeaderSection::Init(); + RWStepAP214::Init(Handle(StepAP214_Protocol)::DownCast(myAdaptorProtocol)); + } Handle(STEPControl_ActorWrite) ActWrite = new STEPControl_ActorWrite; myAdaptorWrite = ActWrite;