Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed concurrency problem when reading messages in ofx mpeClient #8

Merged
merged 1 commit into from

2 participants

@araid

fix that James found to the concurrency problem in getDataMessage

@shiffman
Owner

Awesome, thank you!!!

@shiffman shiffman merged commit 3f54d15 into shiffman:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 ofxMostPixelsEver/src/mpeClientTCP.h
View
7 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; }
Something went wrong with that request. Please try again.