Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created July 6, 2011 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/1068050 to your computer and use it in GitHub Desktop.
Save roxlu/1068050 to your computer and use it in GitHub Desktop.
ofThead blocking does not work
// simple thread class
class MyCustomThread : public ofThread {
protected:
virtual void threadedFunction() {
while(true) {
cout << "My own custom thread!" << endl;
ofSleepMillis(3000);
}
}
};
// using the thread
void testApp::setup(){
// creates a blocking thread (verbose)
cout << "Start: blocking thread\n";
my_thread.startThread(true, true);
cout << "Stopped: blocking thread\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment