void runnable_pair_test(runnable & a, runnable & b) { cerr << "Entering runnable_pair_test" << endl; static thread ut1, ut2; ut1.start(a); ut2.start(b); ut1.join(); ut2.join(); };
inline IVCamSource::~IVCamSource() { //done using it, kill the seg_service stopThread = true; if (camThread.joinable()) camThread.join(); TerminateProcessByName(L"seg_service.exe"); }
void operator()(thread& t) { if (t.joinable()) { t.join(); } }
void operator()(thread& t) { t.interrupt(); if (t.joinable()) { t.join(); } }
~Actor() // <------------ PATCH { execJobSync([this]()->int { d_keepWorkerRunning = false; return 0; }); d_worker.join(); }
void rng_finilize() { rng_producer_done = true; rng_producer_thread.join(); /* Cleanup */ curandDestroyGenerator(gen); cudaFree(devData); }
void StopReceivingMessages() { if (SetEvent(stopRunning)) { messageThread.join(); } else { cerr << "SetEvent failed: " << GetLastError() << "\n"; messageThread.detach(); } }
C_LINKAGE SC_API_EXPORT void unload(InterfaceTable *inTable) { inputThreadRunning = false; uiListenThread.join(); #ifndef _WIN32 if (d) XCloseDisplay(d); #endif }
void join() { if(!thread_.joinable()) return; should_stop_ = true; thread_.join(); }
void SwitcherData::Stop() { if (th.joinable()) { { lock_guard<mutex> lock(m); stop = true; } cv.notify_one(); th.join(); } }
void stop() { if(thread_.joinable()) { { lock_guard lock{m_}; stop_ = true; } cond_.notify_all(); thread_.join(); } }
void stop_log_rotation() { // if no log rotation active, quit. if (!thread_running) return; // join the log rotation thread. lock.lock(); thread_running = false; cond.signal(); lock.unlock(); log_rotate_thread.join(); // we will continue logging to the same location, but we will // delete the symlink unlink(symlink_name.c_str()); }
void obs_module_unload(void) { #ifdef USE_QT_LOOP BrowserShutdown(); #else if (manager_thread.joinable()) { while (!QueueCEFTask([] () {CefQuitMessageLoop();})) os_sleep_ms(5); manager_thread.join(); } #endif os_event_destroy(cef_started_event); }
JNIEXPORT jint JNICALL Java_org_iotivity_ResourceHosting_ResourceHosting_OICCoordinatorStop (JNIEnv *env, jobject obj) { jint result = 0; //terminate Thread if (ocProcessThread.joinable()) { threadRun = false; ocProcessThread.join(); } else { result = (jint)HOSTING_THREAD_ERROR; return result; } result = (jint)OICStopCoordinate(); return result; }
JNIEXPORT jint JNICALL Java_org_iotivity_ResourceHosting_ResourceHosting_ResourceHostingTerminate (JNIEnv *env, jobject obj) { if (OCStop() != OC_STACK_OK) { return (jint)OCSTACK_ERROR; } //terminate Thread if (ocProcessThread.joinable()) { threadRun = false; ocProcessThread.join(); } else { return (jint)HOSTING_THREAD_ERROR; } return (jint)OCSTACK_OK; }
void stop_iocp_thread() { CancelIo(hCom); PostQueuedCompletionStatus (hIOCP,0,KEY_STOP,0); io_thread.join(); }
static VALUE object_test_thread(VALUE rb_self) { t = create_thread(rb_self); t.join(); }
~ScopedThread() { t.join(); }
void Menu_Clicked() { char picked[80]; menubar->item_pathname(picked, sizeof(picked)-1); string selectPath(picked); cout << "Selected Menu Path: " << selectPath << endl; int selected = mediaType->value(); cout << "Selected media type: " << ((select == 0) ? "Music" : "Video") << endl; if(selectPath.compare("File/Save") == 0) { cout << "Menu item Save selected." << endl; } else if(selectPath.compare("File/Restore") == 0) { cout << "Menu item Restore selected." << endl; } else if(selectPath.compare("File/Exit") == 0) { cout << "Menu item Exit selected." << endl; if(playThread != NULL && playThread->joinable()) { playThread->join(); } exit(0); } else if(selectPath.compare("Media/Add") == 0) { cout << "Menu item Add selected." << endl; cout << "Adding media with title: " << titleInput->value() << ", type " << mediaType->value() << " " << endl; MediaDescription file(mediaType->value(), titleInput->value(), authorInput->value(), albumInput->value(), genreInput->value(), filenameInput->value()); bool addRes = false; addRes = (*msc).add(file.toJSONObject()); cout << "Add " << ((addRes) ? "successful" : "unsuccessful") << endl; } else if(selectPath.compare("Media/Remove") == 0) { string title = titleInput->value(); bool remRes = false; remRes = msc->remove(title); cout << "Remove " << ((remRes) ? "successful" : "uneuccessful") << endl; } else if(selectPath.compare("File/Refresh Tree") == 0) { //rebuild tree here buildTree(); } else if(selectPath.compare("Media/Play") == 0) { string unameres = exec("uname"); string pwdPath = exec("pwd"); pwdPath = pwdPath.substr(0, pwdPath.length()-1); cout << "OS type is: " << unameres << " curr.dir is: " << pwdPath << endl; stringstream streamLinux; streamLinux << "/usr/bin/vlc " << pwdPath << "/" << ((mediaType->value() == 0) ? "PaperNavySwanSong.mp3" : "MachuPicchuTimeLapseVimeo.mp4"); string aStr("Linux"); cout << "Linux command: " << streamLinux.str() << endl; string argLinux(streamLinux.str()); cmd = argLinux; playThread = new thread(run); } }
void Solution::endSensing(){ first.join(); }
~Log() { done = true; t.join(); output.close(); }
void inicioHilos(){ thread t(cronometro, 0); thread t2(crearVentana,0); t.join(); t2.join(); }
void kuka::halt() { keepalive = false; comThread.join(); }
~runandjoin() { if (runner.joinable()) runner.join(); }
void stopAsioThread() { ioService.stop(); gAsioThread.join(); }
virtual ~AsioMTImpl() { io_svc.stop(); io_thread.join(); }
void ExtJoin() { if(!m_started || m_finished || m_cancelled) return; m_thread->join(); }
void join() { if (t.joinable()) t.join(); }
void join() { if (runner.joinable()) runner.join(); }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ void AppLogic::stop () { sess.stop (); session_thread.join (); }