]> OCCT Git - occt.git/commitdiff
0033643: Data Exchange, Step Import - Multithread loading model issue CR0-SNVK-780
authordpasukhi <dpasukhi@opencascade.com>
Thu, 14 Mar 2024 22:56:41 +0000 (22:56 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Thu, 14 Mar 2024 22:56:41 +0000 (22:56 +0000)
Workaround for isolate loading entities functionality
  Needs to update logic to process in different threads different model three

src/StepFile/StepFile_Read.cxx

index 26319a7c43e364d9ee7f302cb7dd17121aec78af..72a4a27749eb49093a9c6e397dcdd01c75b2988d 100644 (file)
 
 #include <stdio.h>
 
+#include <Standard_Mutex.hxx>
+
 #ifdef OCCT_DEBUG
 #define CHRONOMESURE
 #endif
 
+namespace
+{
+  static Standard_Mutex THE_GLOBAL_READ_MUTEX;
+}
+
 void StepFile_Interrupt(Standard_CString theErrorMessage, const Standard_Boolean theIsFail)
 {
   if (theErrorMessage == NULL)
@@ -109,7 +116,7 @@ static Standard_Integer StepFile_Read (const char* theName,
 #endif
 
   sout << "      ...    STEP File   Read    ...\n";
-
+  Standard_Mutex::Sentry aLocker(THE_GLOBAL_READ_MUTEX);
   Standard_Integer nbhead, nbrec, nbpar;
   aFileDataModel.GetFileNbR (&nbhead,&nbrec,&nbpar);  // renvoi par lex/yacc
   Handle(StepData_StepReaderData) undirec =