Permalink
Browse files

Merge pull request #8 from araid/fixmessages

fixed concurrency problem when reading messages in ofx mpeClient
  • Loading branch information...
2 parents a2e37c1 + 0635f49 commit 3f54d15280c88f75be490ee079e8a0fefa5188b3 @shiffman committed Dec 11, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 ofxMostPixelsEver/src/mpeClientTCP.h
@@ -57,7 +57,12 @@ class mpeClientTCP : public ofThread {
void broadcast(string _msg);
bool messageAvailable() { return bMessageAvailable; }
- vector<string> getDataMessage() { return dataMessage; }
+ vector<string> getDataMessage() {
+ lock();
+ vector<string> returnMessage = dataMessage;
+ unlock();
+ return returnMessage;
+ }
bool intsAvailable() { return bIntsAvailable; }
vector<int> getInts() { return ints; }
bool bytesAvailable() { return bBytesAvailable; }

0 comments on commit 3f54d15

Please sign in to comment.