busy variable removed
authordisplacer
Tue, 26 Sep 2006 19:59:10 +0000
changeset 170 ef1031ba44fc
parent 169 a78d4a552500
child 171 7acf6c70ea5f
busy variable removed
QTfrontend/hwmap.cpp
QTfrontend/hwmap.h
--- a/QTfrontend/hwmap.cpp	Tue Sep 26 19:45:47 2006 +0000
+++ b/QTfrontend/hwmap.cpp	Tue Sep 26 19:59:10 2006 +0000
@@ -8,7 +8,6 @@
 
 #include <QList>
 
-int HWMap::isBusy(0); // initialize static variable
 QList<HWMap*> srvsList;
 QMutex tcpSrvMut;
 
@@ -42,11 +41,9 @@
   //deleteLater();
 
 
-  tcpSrvMut.lock();
-  if(isBusy) --isBusy;
-  tcpSrvMut.unlock();
   emit ImageReceived(im);
   readbuffer.clear();
+  if(srvsList.size()==1) srvsList.pop_front();
   emit isReadyNow();
 }
 
@@ -100,14 +97,12 @@
 void HWMap::Start()
 {
   tcpSrvMut.lock();
-  if(!isBusy) {
-    ++isBusy;
+  if(srvsList.isEmpty()) {
     srvsList.push_back(this);
     tcpSrvMut.unlock();
   } else {
     connect(srvsList.back(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
     srvsList.push_back(this);
-    //deleteLater();
     tcpSrvMut.unlock();
     return;
   }
--- a/QTfrontend/hwmap.h	Tue Sep 26 19:45:47 2006 +0000
+++ b/QTfrontend/hwmap.h	Tue Sep 26 19:59:10 2006 +0000
@@ -61,7 +61,6 @@
   void isReadyNow();
 
  private:
-  static int isBusy;
   void RealStart();
 
   bool m_isStarted;