Permalink
Browse files

fixed concurrency problem when reading messages in ofx mpeClient

  • Loading branch information...
1 parent a2e37c1 commit 0635f49bab6f71b9ec57604a5b841db5632158c0 @araid 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 0635f49

Please sign in to comment.