]> OCCT Git - occt.git/commit
Coding - Replace Standard_Mutex with std::mutex and migrate to RAII locks (#766)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Mon, 3 Nov 2025 16:44:08 +0000 (16:44 +0000)
committerGitHub <noreply@github.com>
Mon, 3 Nov 2025 16:44:08 +0000 (16:44 +0000)
commit787bee375c628620fdc72b0c6b723cbab3e46f3c
tree02b133437c2ad7be528b778df0ead337f1314461
parentd98f74d893fa3a19cc0b254dbe523eb0ce7d9b8e
Coding - Replace Standard_Mutex with std::mutex and migrate to RAII locks (#766)

- Replace legacy Standard_Mutex usage across many modules with std::mutex.
- Include <mutex> where needed and remove <Standard_Mutex.hxx> includes.
- Replace Standard_Mutex::Sentry / explicit Lock/Unlock with std::lock_guard or std::unique_lock.
- Convert optional/heap mutex holders to std::unique_ptr<std::mutex> and adapt locking accordingly.
- Simplify several singleton initializations (remove manual double-checked locking where safe).
- Use thread_local for per-thread flags instead of ad-hoc mutex protection.
- Fix BVH_BuildQueue Fetch logic to preserve thread counters and wasBusy handling.
- Remove obsolete TopTools_MutexForShapeProvider sources and update FILES.cmake.

This modernizes mutex usage, reduces dependency on custom mutex types and improves clarity of locking patterns.
95 files changed:
src/ApplicationFramework/TKCDF/CDF/CDF_StoreList.cxx
src/ApplicationFramework/TKLCAF/TDF/TDF_DerivedAttribute.cxx
src/DataExchange/TKDE/DE/DE_ConfigurationNode.cxx
src/DataExchange/TKDE/DE/DE_PluginHolder.hxx
src/DataExchange/TKDE/DE/DE_Wrapper.cxx
src/DataExchange/TKDE/DE/DE_Wrapper.hxx
src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx
src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Controller.cxx
src/DataExchange/TKDESTEP/STEPControl/STEPControl_Controller.cxx
src/DataExchange/TKDESTEP/STEPControl/STEPControl_Reader.cxx
src/DataExchange/TKDESTEP/STEPEdit/STEPEdit.cxx
src/DataExchange/TKDESTEP/STEPSelections/STEPSelections_SelectGSCurves.cxx
src/DataExchange/TKDESTEP/STEPSelections/STEPSelections_SelectInstances.cxx
src/DataExchange/TKDESTEP/StepFile/StepFile_Read.cxx
src/DataExchange/TKDESTEP/StepSelect/StepSelect_StepType.cxx
src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx
src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.hxx
src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationReader.cxx
src/DataExchange/TKRWMesh/RWMesh/RWMesh_TriangulationReader.hxx
src/DataExchange/TKXSBase/Interface/Interface_Category.cxx
src/DataExchange/TKXSBase/XSAlgo/XSAlgo_AlgoContainer.cxx
src/DataExchange/TKXSBase/XSControl/XSControl_TransferWriter.cxx
src/DataExchange/TKXSBase/XSControl/XSControl_WorkSession.cxx
src/Draw/TKDCAF/DNaming/DNaming_ModelingCommands.cxx
src/Draw/TKDraw/Draw/Draw_ProgressIndicator.hxx
src/Draw/TKQADraw/QABugs/QABugs_20.cxx
src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.cxx
src/Draw/TKViewerTest/ViewerTest/ViewerTest_ContinuousRedrawer.hxx
src/Draw/TKXSDRAWIGES/XSDRAWIGES/XSDRAWIGES.cxx
src/Draw/TKXSDRAWSTL/XSDRAWSTL/XSDRAWSTL.cxx
src/FoundationClasses/TKMath/BVH/BVH_BuildQueue.cxx
src/FoundationClasses/TKMath/BVH/BVH_BuildQueue.hxx
src/FoundationClasses/TKMath/BVH/BVH_QueueBuilder.hxx
src/FoundationClasses/TKernel/Message/Message_MsgFile.cxx
src/FoundationClasses/TKernel/Message/Message_ProgressIndicator.hxx
src/FoundationClasses/TKernel/Message/Message_Report.cxx
src/FoundationClasses/TKernel/Message/Message_Report.hxx
src/FoundationClasses/TKernel/NCollection/NCollection_HeapAllocator.cxx
src/FoundationClasses/TKernel/NCollection/NCollection_IncAllocator.cxx
src/FoundationClasses/TKernel/NCollection/NCollection_IncAllocator.hxx
src/FoundationClasses/TKernel/OSD/OSD_Environment.cxx
src/FoundationClasses/TKernel/OSD/OSD_Parallel_Threads.cxx
src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.cxx
src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.hxx
src/FoundationClasses/TKernel/OSD/OSD_signal.cxx
src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.cxx
src/FoundationClasses/TKernel/Standard/Standard_ErrorHandler.hxx
src/FoundationClasses/TKernel/Standard/Standard_MMgrOpt.cxx
src/FoundationClasses/TKernel/Standard/Standard_MMgrOpt.hxx
src/FoundationClasses/TKernel/Standard/Standard_StackTrace.cxx
src/FoundationClasses/TKernel/Standard/Standard_Type.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_2.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_4.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_7.cxx
src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_RemoveFeatures.cxx
src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_Parallel.hxx
src/ModelingAlgorithms/TKMesh/IMeshTools/IMeshTools_ModelAlgo.hxx
src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire_1.cxx
src/ModelingAlgorithms/TKShHealing/ShapeProcess/ShapeProcess_Context.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Analyzer.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Edge.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Result.hxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Shell.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Vertex.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx
src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx
src/ModelingData/TKBRep/BinTools/BinTools_ShapeReader.cxx
src/ModelingData/TKBRep/BinTools/BinTools_ShapeWriter.cxx
src/ModelingData/TKBRep/TopTools/FILES.cmake
src/ModelingData/TKBRep/TopTools/TopTools_MutexForShapeProvider.cxx [deleted file]
src/ModelingData/TKBRep/TopTools/TopTools_MutexForShapeProvider.hxx [deleted file]
src/ModelingData/TKG3d/Geom/Geom_BSplineSurface_1.cxx
src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx
src/Visualization/TKService/Aspect/Aspect_VKeySet.hxx
src/Visualization/TKService/Graphic3d/Graphic3d_MediaTexture.cxx
src/Visualization/TKService/Graphic3d/Graphic3d_MediaTexture.hxx
src/Visualization/TKService/Graphic3d/Graphic3d_MediaTextureSet.cxx
src/Visualization/TKService/Graphic3d/Graphic3d_MediaTextureSet.hxx
src/Visualization/TKService/Media/Media_PlayerContext.cxx
src/Visualization/TKService/Media/Media_PlayerContext.hxx
src/Visualization/TKV3d/AIS/AIS_ViewController.cxx
src/Visualization/TKV3d/AIS/AIS_ViewController.hxx
src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.hxx
src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.cxx
src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.hxx
src/Visualization/TKV3d/StdPrs/StdPrs_BRepFont.cxx
src/Visualization/TKV3d/StdPrs/StdPrs_BRepFont.hxx
src/Visualization/TKV3d/StdPrs/StdPrs_BRepTextBuilder.cxx
src/Visualization/TKV3d/StdPrs/StdPrs_WFShape.cxx