Index: /trunk/GnssCenter/map_stations/thriftclient.cpp
===================================================================
--- /trunk/GnssCenter/map_stations/thriftclient.cpp	(revision 5424)
+++ /trunk/GnssCenter/map_stations/thriftclient.cpp	(revision 5425)
@@ -43,5 +43,13 @@
   try {
     transport->open();
-    while (!_stop && processor->process(protocol,protocol,0)) {}
+    while (true) {
+      {
+        QMutexLocker locker(&_mutex);
+        if (_stop) {
+          break;
+        }
+      }
+      processor->process(protocol,protocol,0);
+    }
     transport->close();
   } 
Index: /trunk/GnssCenter/map_stations/thriftclient.h
===================================================================
--- /trunk/GnssCenter/map_stations/thriftclient.h	(revision 5424)
+++ /trunk/GnssCenter/map_stations/thriftclient.h	(revision 5425)
@@ -5,4 +5,5 @@
 #include <map>
 #include <QThread>
+#include <QMutex>
 
 #include <transport/TSocket.h>
@@ -67,7 +68,11 @@
   ~t_thriftClient();
   virtual void run();
-  void stop() {_stop = true;}
+  void stop() {
+    QMutexLocker locker(&_mutex);
+    _stop = true;
+  }
 
  private:
+  QMutex                      _mutex;
   GnssCenter::t_map_stations* _parent;
   bool                        _stop;
