コード例 #1
0
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;
	}
}
コード例 #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);
	}
}
コード例 #3
0
ファイル: ofThread.cpp プロジェクト: CaterTsai/openFrameworks
//-------------------------------------------------
bool ofThread::isCurrentThread() const{
    return ofThread::getCurrentPocoThread() == &getPocoThread();
}