void ofxMtJsonParser::threadedFunction(){

	#if( OF_VERSION_MINOR <= 9 )
	try {
		getPocoThread().setName("ofxMtJsonParser");
		getPocoThread().setOSPriority(Poco::Thread::getMinOSPriority());
	} catch (Poco::SystemException exc) {
		ofLogError("ofxMtJsonParser") << exc.what() << " " << exc.message() << " " << exc.displayText();
	}
	#else
	setThreadName("ofxMtJsonParser");
	#endif

	switch (state) {
		case CHECKING_JSON:
			checkLocalJsonAndSplitWorkload();
			ofSleepMillis(16);
			break;

		case MERGE_THREAD_RESULTS:
			mergeThreadResults();
			ofSleepMillis(16);
			break;

		default: break;
	}
}
Ejemplo n.º 2
0
void testApp::threadedFunction(){

	getPocoThread().setName("MyLoopingThread");

	while(isThreadRunning()){
		TS_START("task");
			ofSleepMillis(30);
			TS_START("subtask1");
			ofSleepMillis(300);
			TS_STOP("subtask1");

		TS_STOP("task");
		ofSleepMillis(100);
	}
}
Ejemplo n.º 3
0
//-------------------------------------------------
bool ofThread::isCurrentThread() const{
    return ofThread::getCurrentPocoThread() == &getPocoThread();
}