Index: /trunk/GnssCenter/thrift/test2/server.cpp
===================================================================
--- /trunk/GnssCenter/thrift/test2/server.cpp	(revision 4952)
+++ /trunk/GnssCenter/thrift/test2/server.cpp	(revision 4953)
@@ -8,4 +8,5 @@
 #include <thrift/concurrency/Thread.h>
 #include <thrift/concurrency/PosixThreadFactory.h>
+#include <thrift/concurrency/Mutex.h>
 
 #include "gen-cpp/myService.h"
@@ -28,4 +29,5 @@
 };
 
+Mutex MUTEX;
 shared_ptr<t_connection> CONNECTION;
 
@@ -34,4 +36,7 @@
   myProcessorFactory() {};
   shared_ptr<TProcessor>   getProcessor(const TConnectionInfo& info) {
+
+    Guard m(MUTEX);
+
     shared_ptr<myServiceClient> client(new myServiceClient(info.output));
     shared_ptr<TProcessor>      processor(new myServiceProcessor(client));
@@ -78,6 +83,9 @@
   try {
     while (true) {
-      if (CONNECTION) {
-        CONNECTION->_client->answer("How are you?");
+      {
+        Guard m(MUTEX);
+        if (CONNECTION) {
+          CONNECTION->_client->answer("How are you?");
+        }
       }
       sleep(1);
