//===========================================================================
static int mySCnt = 0;
- static int myQCnt = 0;
- static int myIsBatchMode = 0;
- Mutex::Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay) :
- myQApp(theQApp), isQAppLocked(theQApp->locked()), myDelay(theDelay),
- myMutex(theMutex), isSessionLocked(theMutex->locked())
- {
- if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
- if(!myIsBatchMode && isQAppLocked) myIsBatchMode++;
- if(!isSessionLocked && !mySCnt) { myMutex->lock();}; mySCnt++;
- if(!isQAppLocked && !myQCnt) {
- myQApp->lock();
- myQApp->syncX();
- };
- myQCnt++;
+ Mutex::Mutex(QMutex* theMutex): myMutex(theMutex){
+ if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<!mySCnt);
+ if(!mySCnt++)
+ myMutex->lock();
}
Mutex::~Mutex(){
- myQCnt--;
- if(!isQAppLocked && !myQCnt) {
- myQApp->flushX();
- //if(myDelay > 0)
- myQApp->processEvents(myDelay+3);
- myQApp->unlock();
- }
- mySCnt--; if(!isSessionLocked && !mySCnt) { myMutex->unlock();}
- if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
+ if(!(--mySCnt))
+ myMutex->unlock();
+ if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<!mySCnt);
}
}
void Storable::Registry(const char* theComment, TStorableEngine theEngine)
- throw(std::logic_error&)
{
if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
}
Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
const string& thePrefix, const string& theLocalPersistentID)
- throw (std::runtime_error&)
{
try{
QString strIn( theLocalPersistentID.c_str() );
}
const QString& Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
- throw(std::logic_error&)
{
TRestoringMap::const_iterator i = theMap.find(theArg);
if(i == theMap.end()) {
anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
aCmnt->SetValue(theComment);
- INFOS("CreateAttributes - Comment = "<<theComment);
+ if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
}
if(strcmp(theRefFatherEntry,"") != 0){
SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);