Changeset 9 in chevmsgr
- Timestamp:
- 08/30/15 10:11:52 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/msgclnt.cpp
r8 r9 50 50 void MessageQ::push(const Protocol::Message & parser) 51 51 { 52 SYNCHRONIZED(mutex) 53 { 54 messageQ.push_back(parser); 55 } 52 mutex.lock(); 53 messageQ.push_back(parser); 54 mutex.unlock(); 56 55 } 57 56 … … 60 59 while (true) 61 60 { 62 SYNCHRONIZED(mutex) 63 { 64 Protocol::Message parser = messageQ.front(); 65 66 if (parser.type() == requestType) 67 { 68 messageQ.erase(messageQ.begin()); 69 70 return parser; 71 } 72 } 61 mutex.lock(); 62 Protocol::Message parser = messageQ.front(); 63 64 if (parser.type() == requestType) 65 { 66 messageQ.erase(messageQ.begin()); 67 68 return parser; 69 } 70 mutex.unlock(); 73 71 } 74 72 }
Note:
See TracChangeset
for help on using the changeset viewer.