}
//===========================================================================
- static int mySCnt = 0;
- static int myQCnt = 0;
- static int myIsBatchMode = 0;
+// 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(){
- 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));
- }
+// 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(){
+// 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));
+// }
//===========================================================================
#include "SALOME_NamingService.hxx"
#include "SALOME_LifeCycleCORBA.hxx"
#include "Utils_CorbaException.hxx"
+#include "SALOMEGUI_VisuMutex.hxx"
#include "utilities.h"
#include <stdexcept>
//===========================================================================
- class Mutex{
- QMutex* myMutex;
- QApplication* myQApp;
- int isQAppLocked, isSessionLocked, myDelay;
- public:
- Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay = 0);
- ~Mutex();
- };
+// class Mutex{
+// QMutex* myMutex;
+// QApplication* myQApp;
+// int isQAppLocked, isSessionLocked, myDelay;
+// public:
+// Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay = 0);
+// ~Mutex();
+// };
//===========================================================================
//omni_mutex_lock aMutexLock(aMutex);
if(MYDEBUG) MESSAGE("VISU_Gen_i::GetViewManager : "<<myMutex);
if(myMutex){
- Mutex mt(myMutex,qApp);
+ SMutex mt(myMutex,qApp);
ViewManager_i * aViewManager = new ViewManager_i(myStudyDocument);
return ViewManager::_duplicate(aViewManager->_this());
}
*/
ViewManager_i::ViewManager_i(SALOMEDS::Study_ptr theStudy) {
if(MYDEBUG) MESSAGE("ViewManager_i::ViewManager_i");
- Mutex mt(myMutex,qApp,MYDELAY);
+ SMutex mt(myMutex,qApp,MYDELAY);
myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
//TViewManager* aTViewManager = new TViewManager(theStudy);
//aTViewManager->start();
VISU::View3D_ptr ViewManager_i::Create3DView(){
- Mutex mt(myMutex,qApp,MYDELAY);
+ //Mutex mt(myMutex,qApp,MYDELAY);
if(MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
VISU::View3D_i* pView = new View3D_i(myStudyDocument);
if(pView->Create(1) != NULL)
void ViewManager_i::ProcessEvents() {
while (true) {
+ MESSAGE("--- must never be called ! ---");
+ ASSERT(0);
qApp->lock();
qApp->syncX();
qApp->flushX();