Changeset 4953 in ntrip
- Timestamp:
- Feb 23, 2013, 5:36:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/thrift/test2/server.cpp
r4952 r4953 8 8 #include <thrift/concurrency/Thread.h> 9 9 #include <thrift/concurrency/PosixThreadFactory.h> 10 #include <thrift/concurrency/Mutex.h> 10 11 11 12 #include "gen-cpp/myService.h" … … 28 29 }; 29 30 31 Mutex MUTEX; 30 32 shared_ptr<t_connection> CONNECTION; 31 33 … … 34 36 myProcessorFactory() {}; 35 37 shared_ptr<TProcessor> getProcessor(const TConnectionInfo& info) { 38 39 Guard m(MUTEX); 40 36 41 shared_ptr<myServiceClient> client(new myServiceClient(info.output)); 37 42 shared_ptr<TProcessor> processor(new myServiceProcessor(client)); … … 78 83 try { 79 84 while (true) { 80 if (CONNECTION) { 81 CONNECTION->_client->answer("How are you?"); 85 { 86 Guard m(MUTEX); 87 if (CONNECTION) { 88 CONNECTION->_client->answer("How are you?"); 89 } 82 90 } 83 91 sleep(1);
Note:
See TracChangeset
for help on using the changeset viewer.