_isLocal = true;
_local_impl = theStudy;
_corba_impl = SALOMEDS::Study::_nil();
+
+ pthread_mutex_init( &SALOMEDS_StudyBuilder::_remoteBuilderMutex, 0 );
+
init_orb();
}
long pid = (long)getpid();
#endif
+ pthread_mutex_init( &SALOMEDS_StudyBuilder::_remoteBuilderMutex, 0 );
+
long addr = theStudy->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
if(_isLocal) {
_local_impl = reinterpret_cast<SALOMEDSImpl_Study*>(addr);
#include "Utils_ORB_INIT.hxx"
#include "Utils_SINGLETON.hxx"
+pthread_mutex_t SALOMEDS_StudyBuilder::_remoteBuilderMutex;
+
SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder)
{
_isLocal = true;
SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder)
{
+ pthread_mutex_lock( &_remoteBuilderMutex );
_isLocal = false;
_local_impl = NULL;
_corba_impl = SALOMEDS::StudyBuilder::_duplicate(theBuilder);
SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder()
{
+ if (!_isLocal) pthread_mutex_unlock( &_remoteBuilderMutex );
}
_PTR(SComponent) SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType)
#include "SALOMEDSClient.hxx"
#include "SALOMEDSImpl_StudyBuilder.hxx"
+#include <pthread.h>
// IDL headers
#include <SALOMEconfig.h>
SALOMEDS::StudyBuilder_var _corba_impl;
CORBA::ORB_var _orb;
+
public:
+ static pthread_mutex_t _remoteBuilderMutex;
SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder);
SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);