Why this is behaving like this:
Thread class:
#include "ofMain.h"
class CmdThread : public ofThread {
public:
CmdThread(){}
void threadedFunction(){
cout << "it is on!" << endl;
}
};
testApp.cpp:
void testApp::setup(){
CmdThread cmd;
cmd.startThread(true, false); // this gives me no output but this,
// [warning] Thread 1: override threadedFunction with your own
}
And:
void testApp::setup(){
CmdThread cmd;
cmd.startThread(true, false);
cmd.startThread(true, false); // Now, this works and gives output,
// it is on and ON!
// [warning] Thread 1: cannot start, thread already
// running
}
The OF provided thread example is working fine. I’m using OF 0.80 VS2012.