这篇教程C++ waitForThread函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中waitForThread函数的典型用法代码示例。如果您正苦于以下问题:C++ waitForThread函数的具体用法?C++ waitForThread怎么用?C++ waitForThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了waitForThread函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: getThreadint Thread::start(int32_t id) { Thread *thread = getThread(id); if (thread == NULL || thread->starting || id==main_threadid) return 1; if(thread->state == THREAD_RUNNING) return 2; if(thread->terminated) return 4; thread->exited = false; thread->state = THREAD_CREATED; thread->starting = 1;#ifdef WIN32_ thread->thread = CreateThread( NULL, // default security attributes 0, // use default stack size &vm->InterpreterThreadStart, // thread function caller thread, // thread self when thread is created 0, // use default creation flags NULL); if(thread->thread == NULL) return 3; // thread was not started else return waitForThread(thread);#endif#ifdef POSIX_ if(pthread_create( &thread->thread, NULL, vm->InterpreterThreadStart, (void*) thread)) return 3; // thread was not started else { return waitForThread(thread); }#endif}
开发者ID:AndroDevcd,项目名称:Sharp,代码行数:35,
示例2: CreateThreadint Thread::startDaemon(#ifdef WIN32_ DWORD WINAPI#endif#ifdef POSIX_void*#endif(*threadFunc)(void *), Thread *thread) { if (thread == NULL || !thread->daemon) return 1; if(thread->state == THREAD_RUNNING) return 2; thread->exited = false;#ifdef WIN32_ thread->thread = CreateThread( NULL, // default security attributes 0, // use default stack size (LPTHREAD_START_ROUTINE)threadFunc, // thread function caller thread, // thread self when thread is created 0, // use default creation flags NULL); if(thread->thread == NULL) return 3; // thread was not started else return waitForThread(thread);#endif#ifdef POSIX_ if(pthread_create( &thread->thread, NULL, threadFunc, (void*) thread)!=0) return 3; // thread was not started else return waitForThread(thread);#endif}
开发者ID:AndroDevcd,项目名称:Sharp,代码行数:34,
示例3: stopThread//--------------------------bool ofxTCPServer::close(){ stopThread(); if( !TCPServer.Close() ){ ofLogWarning("ofxTCPServer") << "close(): couldn't close connections"; waitForThread(false); // wait for the thread to finish return false; }else{ ofLogVerbose("ofxTCPServer") << "Closing server"; waitForThread(false); // wait for the thread to finish return true; }}
开发者ID:4ker,项目名称:openFrameworks,代码行数:13,
示例4: waitForThread//--------------------------------------------------------------------------------void ofxKinectV2::close(){ if( bOpened ){ waitForThread(true); protonect.closeKinect(); bOpened = false; }}
开发者ID:ryokun0924,项目名称:kinectv2Adjust,代码行数:8,
示例5: waitForThreadDetachThreadQueue::~DetachThreadQueue(){ timeToStop = true; //lets flag the thread so that it doesnt try access stuff while we delete things around if(verbose) printf("DetachThreadQueue::~DetachThreadQueue() waiting for queue thread.../n"); if (isThreadRunning()) waitForThread(); if(verbose) printf("DetachThreadQueue::~DetachThreadQueuedeleting deleting pending, processing and processed work units.../n"); while ( processing.size() > 0 ){ GenericWorkUnit * w = processing[0]; if ( w->isThreadRunning() ){ w->weAreBeingDeleted = true; w->cancel(); if(verbose) printf("WorkUnit(%d) waitForThread at destructor /n", w->getID()); w->waitForThread(); } processing.erase( processing.begin() ); delete w; } while ( pending.size() > 0 ){ GenericWorkUnit * w = pending[0]; pending.erase( pending.begin() ); delete w; } while ( processed.size() > 0 ){ GenericWorkUnit * w = processed[0]; processed.erase( processed.begin() ); delete w; } if(verbose) printf("~DetachThreadQueue() done!/n");}
开发者ID:armadillu,项目名称:ofxWorkQueues,代码行数:31,
示例6: stopThreadvoid ofxThreadedMidiPlayer::stop(){ cout << __PRETTY_FUNCTION__ << endl; stopThread(); waitForThread(); // clean(); }
开发者ID:jeonghopark,项目名称:ofxThreadedMidiPlayer,代码行数:7,
示例7: while//--------------------------------------------------------------void ofxVideoRecorder::threadedFunction(){ if(bRecordVideo && bRecordAudio) { while(frames.size() > 0 && audioFrames.size() > 0) { // if there are frames in the queue or the thread is writing, signal them until the work is done. videoThread.signal(); audioThread.signal(); } } else if(bRecordVideo) { while(frames.size() > 0) { // if there are frames in the queue or the thread is writing, signal them until the work is done. videoThread.signal(); } } else if(bRecordAudio) { while(audioFrames.size() > 0) { // if there are frames in the queue or the thread is writing, signal them until the work is done. audioThread.signal(); } } waitForThread(); outputFileComplete();}
开发者ID:danielmorena,项目名称:ofxVideoRecorder,代码行数:27,
示例8: waitForThread//---------------------------------------------------------------------------void ofxKinect::close(){ if(isThreadRunning()){ waitForThread(true); } bNeedsUpdate = false; bUpdateTex = false;}
开发者ID:ofantwerpen,项目名称:ofantwerpen,代码行数:9,
示例9: waitForThreadKinectGrabber::~KinectGrabber(){ // when the class is destroyed // close both channels and wait for // the thread to finish // toAnalyze.close(); // analyzed.close(); waitForThread(true);}
开发者ID:thomwolf,项目名称:example-ofxKinect,代码行数:8,
示例10: stopThreadvoid ofxColorStream::exit(){ stopThread(); waitForThread(); stream->stop(); stream->destroy();}
开发者ID:eranws,项目名称:ofxOpenNi2,代码行数:8,
示例11: waitForThread//--------------------------------------------------------------IntelFaceScanner::~IntelFaceScanner(){ scanningData.close(); waitForThread(true); close();}
开发者ID:pierrep,项目名称:IntelFaceScanner,代码行数:9,
示例12: waitForThread //-------------------------------------------------------------- void Reactor::exit(){ if (context != NULL) { waitForThread(true); libwebsocket_context_destroy(context); context = NULL; } }
开发者ID:Geistyp,项目名称:ofxLibwebsockets,代码行数:9,
示例13: waitForThreadImgAnalysisThread::~ImgAnalysisThread(){ // when the class is destroyed // close both channels and wait for // the thread to finish toAnalyze.close(); analyzed.close(); waitForThread(true);}
开发者ID:Daandelange,项目名称:openFrameworks,代码行数:8,
示例14: waitForThread//--------------------------------------------------------------------------------void ofxKinectV2::close() { if (!bOpened) return; waitForThread(true); closeKinect(); bOpened = false;}
开发者ID:UltraCombos,项目名称:ofxKinectV2,代码行数:9,
示例15: waitForThread//--------------------------------------------------------------void CloudsVHXAuth::update(ofEventArgs& args){ if (bNotifyComplete) { //Wait to ensure the thread has stopped //JG Added this... Elie please advise waitForThread(true); Mode completedMode = mode; mode = WAITING; if (completedMode == REQUEST_TOKEN) { ofNotifyEvent(requestTokenComplete, completeArgs); } else if (completedMode == REFRESH_TOKEN) { ofNotifyEvent(refreshTokenComplete, completeArgs); } else if (completedMode == REQUEST_CODE) { ofNotifyEvent(requestCodeComplete, completeArgs); } else if (completedMode == LINK_CODE) { ofNotifyEvent(linkCodeComplete, completeArgs); } else if (completedMode == VERIFY_PACKAGE) { ofNotifyEvent(verifyPackageComplete, completeArgs); } bNotifyComplete = false; } time_t nowTime = (ofGetSystemTime() / 1000.f); // Refresh token if it's expired. if (mode == WAITING && _tokenExpiry && nowTime > _tokenExpiry) { if (_refreshToken.empty()) { requestToken(); } else { refreshToken(); } } // Reset code if it's expired. if (_codeExpiry && nowTime > _codeExpiry) { _code = ""; _codeExpiry = 0; CloudsVHXEventArgs args; ofNotifyEvent(codeExpired, args); } // Update state if package expired. if (state == RENTAL && _packageExpiry && nowTime > _packageExpiry) { state = EXPIRED; CloudsVHXEventArgs args; ofNotifyEvent(packageExpired, args); }}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:CLOUDS,代码行数:59,
示例16: ofLogVerbosevoid ofxOMXPlayer::close(ofEventArgs & a){ ofLogVerbose() << "start ofxOMXPlayer::close"; waitForThread(true); ofRemoveListener(ofEvents().exit, this, &ofxOMXPlayer::close); ofLogVerbose() << "reached end of ofxOMXPlayer::close";}
开发者ID:PTS93,项目名称:ofxOMXPlayer,代码行数:9,
示例17: waitForThread//---------------------------------------------------------------------------void ofxKinect::close() { if(isThreadRunning()) { waitForThread(true); } //usleep(500000); // some time while thread is stopping ... //libusb_exit(NULL);}
开发者ID:silviopaganini,项目名称:BlackBox,代码行数:10,
示例18: stopThreadbool ofxNetworkSyncClientState::close(){ if(isThreadRunning()){ stopThread(); waitForThread(); } calibrator.close(); server = NULL; tcpServer = NULL;}
开发者ID:danielmorena,项目名称:ofxNetworkSync,代码行数:9,
示例19: waitForThreadofxThreadedImage::~ofxThreadedImage(){ if (isThreadRunning()){ try { waitForThread(true); }catch(Exception &ex) { ofLogError("ofxThreadedImage", "Exception at waitForThread %s/n", ex.displayText().c_str() ); } }}
开发者ID:CameraArts,项目名称:derMaskenbauerApp,代码行数:9,
示例20: cancel void cancel(){ if(loading){ ofRemoveListener(ofEvents().update, this, &ofxImageSequenceLoader::updateThreadedLoad); lock(); cancelLoading = true; unlock(); loading = false; waitForThread(true); } }
开发者ID:outsidecontext,项目名称:ofxImageSequence,代码行数:10,
示例21: PRINT1ThreadedAudioDevice::~ThreadedAudioDevice(){ // This code handles the rare case where the child thread is starting // at the same instant that the device is being destroyed. PRINT1("~ThreadedAudioDevice/n"); if (starting() && _thread != 0) { waitForThread(); starting(false); }}
开发者ID:eriser,项目名称:rtcmix-android,代码行数:10,
示例22: waitForThread//--------------------------------------------------------------ofxThreadedVideo::~ofxThreadedVideo(){ // stop threading waitForThread(true); // close anything left open videos[0].close(); videos[1].close();}
开发者ID:oaragones,项目名称:ofxThreadedVideo,代码行数:11,
示例23: waitForThread//--------------------------------------------------------------void Reactor::exit() { if (context != NULL) { waitForThread(true); // on windows the app does crash if the context is destroyed // while the thread or the library still might hold pointers // better to live with non deleted memory, or? //libwebsocket_context_destroy(context); context = NULL; }}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:ofxLibwebsockets,代码行数:12,
示例24: waitForThread//---------------------------------------------------------------------------void ofxKinect::close() { if(isThreadRunning()) { waitForThread(true); } deviceId = -1; serial = ""; bIsFrameNew = false; bNeedsUpdate = false; bUpdateTex = false;}
开发者ID:CNCBASHER,项目名称:ofxKinect,代码行数:12,
注:本文中的waitForThread函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ waitNotBusy函数代码示例 C++ waitForEvent函数代码示例 |