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

0029195: OCAF - ensure thread safety for different documents.

OCAF persistence architecture modification to satisfy multi-threading criteria.
This commit is contained in:
mpv
2020-08-26 10:15:22 +03:00
committed by abv
parent c3e0e1de43
commit d9d03f10c3
39 changed files with 570 additions and 606 deletions

View File

@@ -25,7 +25,8 @@
#include <Message_Msg.hxx>
#include <Message_MsgFile.hxx>
#include <Resource_Manager.hxx>
#include <CDF_Session.hxx>
#include <OSD_Thread.hxx>
#include <stdio.h>
#include "TObj_TObj_msg.pxx"
@@ -36,11 +37,13 @@ IMPLEMENT_STANDARD_RTTIEXT(TObj_Application,TDocStd_Application)
//function : GetInstance
//purpose :
//=======================================================================
Handle(TObj_Application) TObj_Application::GetInstance()
{
static Handle(TObj_Application) anInstance = new TObj_Application;
return anInstance;
Handle(CDF_Session) aSession = CDF_Session::Create();
Handle(CDF_Application) anApp;
if (aSession->FindApplication(OSD_Thread::Current(), anApp))
return Handle(TObj_Application)::DownCast(anApp);
return new TObj_Application;
}
//=======================================================================