コード例 #1
0
ファイル: thread_test.cpp プロジェクト: fpstovall/nrtb_beta
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();
};
コード例 #2
0
ファイル: realsense.cpp プロジェクト: AnthonySuper/obs-studio
	inline IVCamSource::~IVCamSource()
	{
		//done using it, kill the seg_service
		stopThread = true;
		if (camThread.joinable()) camThread.join();
		TerminateProcessByName(L"seg_service.exe");
	}
コード例 #3
0
 void operator()(thread& t)
 {
   if (t.joinable())
   {
     t.join();
   }
 }
コード例 #4
0
 void operator()(thread& t)
 {
   t.interrupt();
   if (t.joinable())
   {
     t.join();
   }
 }
コード例 #5
0
ファイル: main.cpp プロジェクト: CCJY/coliru
 ~Actor() // <------------ PATCH
 {
     execJobSync([this]()->int
     {
         d_keepWorkerRunning = false;
         return 0;
     });
     d_worker.join();
 }
コード例 #6
0
ファイル: rnd_generator.cpp プロジェクト: revitmt/misc
void rng_finilize()
{
    rng_producer_done = true;
    rng_producer_thread.join();

    /* Cleanup */
    curandDestroyGenerator(gen);
    cudaFree(devData);
}
コード例 #7
0
ファイル: IPC.cpp プロジェクト: YaLTeR/TASView
	void StopReceivingMessages()
	{
		if (SetEvent(stopRunning)) {
			messageThread.join();
		} else {
			cerr << "SetEvent failed: " << GetLastError() << "\n";
			messageThread.detach();
		}
	}
コード例 #8
0
ファイル: UIUGens.cpp プロジェクト: 8c6794b6/supercollider
C_LINKAGE SC_API_EXPORT void unload(InterfaceTable *inTable)
{
	inputThreadRunning = false;
	uiListenThread.join();

#ifndef _WIN32
	if (d)
		XCloseDisplay(d);
#endif
}
コード例 #9
0
ファイル: tiobench.cpp プロジェクト: rodrigostrauss/tio
	void join()
	{
		if(!thread_.joinable())
			return;

		should_stop_ = true;

		thread_.join();

	}
コード例 #10
0
void SwitcherData::Stop()
{
	if (th.joinable()) {
		{
			lock_guard<mutex> lock(m);
			stop = true;
		}
		cv.notify_one();
		th.join();
	}
}
コード例 #11
0
 void stop()
 {
     if(thread_.joinable())
     {
         {
             lock_guard lock{m_};
             stop_ = true;
         }
         cond_.notify_all();
         thread_.join();
     }
 }
コード例 #12
0
ファイル: log_rotate.cpp プロジェクト: Hannah1999/Dato-Core
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());
}
コード例 #13
0
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);
}
コード例 #14
0
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;
}
コード例 #15
0
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;
}
コード例 #16
0
ファイル: blockwise_impl.cpp プロジェクト: stdk/u2
	void stop_iocp_thread()
	{
		CancelIo(hCom);
		PostQueuedCompletionStatus (hIOCP,0,KEY_STOP,0);
		io_thread.join();
	}
コード例 #17
0
ファイル: socker_in_c.cpp プロジェクト: JesseYang/socker
static VALUE object_test_thread(VALUE rb_self) {
	t = create_thread(rb_self);
	t.join();
}
コード例 #18
0
 ~ScopedThread()
 { 
     t.join();
 }
コード例 #19
0
ファイル: MediaClient.cpp プロジェクト: jabocg/SER321-Assign5
    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);

        }

    }
コード例 #20
0
void Solution::endSensing(){
  first.join();
}
コード例 #21
0
ファイル: Log.hpp プロジェクト: mantaraya36/cuttlebone
 ~Log() {
   done = true;
   t.join();
   output.close();
 }
コード例 #22
0
ファイル: main.cpp プロジェクト: KENNETHOROZCO/LABERINTO
void inicioHilos(){
    thread t(cronometro, 0);
    thread t2(crearVentana,0);
    t.join();
    t2.join();
}
コード例 #23
0
ファイル: thomas.cpp プロジェクト: saszaz/boeing-project
void kuka::halt() {
	keepalive = false;
	comThread.join();
}
コード例 #24
0
ファイル: util.hpp プロジェクト: straszheim/ecto
 ~runandjoin() {
   if (runner.joinable())
     runner.join();
 }
コード例 #25
0
ファイル: SC_ComPort.cpp プロジェクト: 8c6794b6/supercollider
void stopAsioThread()
{
	ioService.stop();
	gAsioThread.join();
}
コード例 #26
0
ファイル: asio_mt_impl.cpp プロジェクト: stdk/u2
	virtual ~AsioMTImpl() {
		io_svc.stop();
		io_thread.join();
	}
コード例 #27
0
ファイル: threading.cpp プロジェクト: nobuyukinyuu/diddy
	void ExtJoin() {
		if(!m_started || m_finished || m_cancelled) return;
		m_thread->join();
	}
コード例 #28
0
 void join() {
     if (t.joinable())
         t.join();
 }
コード例 #29
0
ファイル: util.hpp プロジェクト: straszheim/ecto
 void join()
 {
   if (runner.joinable())
     runner.join();
 }
コード例 #30
0
ファイル: test_RegisterModule.cpp プロジェクト: alfmep/uxmpp
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void AppLogic::stop ()
{
    sess.stop ();
    session_thread.join ();
}