当前位置: 首页>>代码示例>>C++>>正文


C++ Thread::Stop方法代码示例

本文整理汇总了C++中Thread::Stop方法的典型用法代码示例。如果您正苦于以下问题:C++ Thread::Stop方法的具体用法?C++ Thread::Stop怎么用?C++ Thread::Stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Thread的用法示例。


在下文中一共展示了Thread::Stop方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Stop

void PrePostProcessor::Stop()
{
	Thread::Stop();
	DownloadQueue* pDownloadQueue = g_pQueueCoordinator->LockQueue();

#ifndef DISABLE_PARCHECK
	m_ParCoordinator.Stop();
#endif

	if (!pDownloadQueue->GetPostQueue()->empty())
	{
		PostInfo* pPostInfo = pDownloadQueue->GetPostQueue()->front();
		if ((pPostInfo->GetStage() == PostInfo::ptUnpacking ||
			 pPostInfo->GetStage() == PostInfo::ptExecutingScript) && 
			pPostInfo->GetPostThread())
		{
			Thread* pPostThread = pPostInfo->GetPostThread();
			pPostInfo->SetPostThread(NULL);
			pPostThread->SetAutoDestroy(true);
			pPostThread->Stop();
		}
	}

	g_pQueueCoordinator->UnlockQueue();
}
开发者ID:Bootz,项目名称:nzbget,代码行数:25,代码来源:PrePostProcessor.cpp

示例2: DoUpdate

void UpdateManager::DoUpdate(string MasterUpdateFile){

	if ( CheckForUpdate(MasterUpdateFile) )
	{
		if (UpdatePackageYesOrNo())
		{
			MyThread.m_Data.Message = "";
			MyThread.m_Data.WorkingBytesDownloaded =0;
			MyThread.m_Data.State = ThreadData::ONLINEDOWNLOAD_UPDATE;

			//update
			UpdateApplicationFiles();
			
			MyThread.m_Data.Message = "";
			MyThread.m_Data.WorkingBytesDownloaded =0;
			MyThread.m_Data.State = ThreadData::UPDATE_COMPLETE_RESET;

			Util::SleepForMilisec(15); // give that above stuff time to kick in and display
			MyThread.Stop();
	
			m_pWiiManager->UnInitWii();
			exit(0);
		}
	}
}
开发者ID:mightymouse2016,项目名称:wii-bolt-thrower,代码行数:25,代码来源:UpdateManager.cpp

示例3: signalThreadAllStop

void ThreadingManager::signalThreadAllStop() {
    std::set<Thread *>::iterator i;
    Thread *p;
    for (i = threadSet.begin(); i != threadSet.end(); i++) {
        p = i.operator *();
        p->Stop();
    }

}
开发者ID:ddalex,项目名称:Lemon-Web-Server,代码行数:9,代码来源:ThreadingManager.cpp

示例4:

ThreadPool::~ThreadPool()
{
	while(!pool.empty())
	{
		Thread t = pool.back();
		pool.pop_back();
		t.Stop();
	}
}
开发者ID:BZz-xx,项目名称:library,代码行数:9,代码来源:ThreadPool.cpp

示例5: Stop

void ThreadPool::Stop()
{
	for(int i = 0; i < capacity; ++i)
	{
		Thread t = pool.front();
		pool.pop_front();
		t.Stop();
	}
}
开发者ID:BZz-xx,项目名称:library,代码行数:9,代码来源:ThreadPool.cpp

示例6: testThreadCancel

      /**
       * \brief Test the cancelation of thread. 
       */
      void testThreadCancel()
      {
        void* ret = NULL;
        Callback obj;
        Thread th = Thread(new ThreadArgImpl<Callback>(obj, &Callback::Call2, NULL));

        th.Start(false);
        th.Stop();
        th.Join(&ret);
        
        /* on x86 it returns 0xffffffff
         * on x86-64 0xffffffffffffffff
         * so (void*)-1
         */
        CPPUNIT_ASSERT(ret == (void*)-1);
      }
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:19,代码来源:test-system.cpp

示例7: DownloadFilesListedInConfiguration

//
// This function Downloads Files read from the configuration, using anything keep in AddURI
//		<AddFile 	URI="http://wii-bolt-thrower.googlecode.com/hg/Data/BoltThrower_v0.62/boot.dol"
//					FullDownloadPath="/" OverwriteExistingFile="YES"/>
//
bool UpdateManager::DownloadFilesListedInConfiguration(bool MisssingCheckOnly)
{
	URLManager* pURLManager = m_pWiiManager->GetURLManager();

	if (pURLManager->m_Initialised) {

		if (!MisssingCheckOnly) {
			MyThread.Start(ThreadData::ONLINEDOWNLOAD_EXTRAFILES);
		}

		// download missing files
		for ( vector<FileInfo>::iterator Iter( m_pWiiManager->GetDownloadInfoBegin()); Iter !=  m_pWiiManager->GetDownloadInfoEnd() ; ++Iter )
		{
			string FullDownloadPath(WiiFile::GetGamePath() + Iter->FullDownloadPath );
			string FullDownloadPathWithoutEndSlash = FullDownloadPath.substr(0,FullDownloadPath.rfind("/"));

			string URI_FilePath ( Iter->LogicName.c_str() );
			string FileName ( FullDownloadPath + WiiFile::GetFileNameWithoutPath( URI_FilePath ) );

			if ( !(WiiFile::CheckFileExist(FileName)) )
			{
				if (MisssingCheckOnly) {
					return true;
				}
				else {
					if ( !(WiiFile::CheckFileExist(FullDownloadPathWithoutEndSlash)) ) {
						mkdir(FullDownloadPathWithoutEndSlash.c_str(), 0777);
					}

					MyThread.m_Data.Message = "downloading "+ WiiFile::GetFileNameWithoutPath(URI_FilePath);
					if ( ! pURLManager->SaveURI(URI_FilePath , FullDownloadPath ) )
						MyThread.m_Data.Message = "Not Found "+ WiiFile::GetFileNameWithoutPath(URI_FilePath);
				}
			}
		}

		if (!MisssingCheckOnly)
			MyThread.Stop();

		//Refresh music list - may have just download something
		m_pWiiManager->ScanMusicFolder();

	}
	return false;
}
开发者ID:mightymouse2016,项目名称:wii-bolt-thrower,代码行数:50,代码来源:UpdateManager.cpp

示例8: Stop

void PrePostProcessor::Stop()
{
	Thread::Stop();
	GuardedDownloadQueue guard = DownloadQueue::Guard();

#ifndef DISABLE_PARCHECK
	m_parCoordinator.Stop();
#endif

	if (m_curJob && m_curJob->GetPostInfo() &&
		(m_curJob->GetPostInfo()->GetStage() == PostInfo::ptUnpacking ||
		 m_curJob->GetPostInfo()->GetStage() == PostInfo::ptExecutingScript) &&
		m_curJob->GetPostInfo()->GetPostThread())
	{
		Thread* postThread = m_curJob->GetPostInfo()->GetPostThread();
		m_curJob->GetPostInfo()->SetPostThread(nullptr);
		postThread->SetAutoDestroy(true);
		postThread->Stop();
	}
}
开发者ID:outtahere,项目名称:nzbget,代码行数:20,代码来源:PrePostProcessor.cpp

示例9: Window2_Closing

void Window2_Closing(Win32Window*)
{
	worker.Stop();
	worker.Close();
}
开发者ID:IwishIcanFLighT,项目名称:Asylum_Tutorials,代码行数:5,代码来源:window2.cpp

示例10: StopThread

		void StopThread() {
			if(m_thread != NULL) {
				m_thread->Stop();
				WAWO_DELETE(m_thread);
			}
		}
开发者ID:ycopy,项目名称:wawo,代码行数:6,代码来源:Thread.hpp

示例11: _tWinMain


//.........这里部分代码省略.........

    if (_tcsstr(ext_options,TEXT("-break"))) {
        LOG(TEXT("debugger breakpoint"));
        __debugbreak();
    }

#ifdef _M_IX86
    // activate GDB remote debugging stub if no other debugger is running
    if (use_gdb_stub) {
        LOG(TEXT("waiting for debugger connection...\n"));

        initialize_gdb_stub();
    }
#endif

    g_Globals.init(hInstance);

    // initialize COM and OLE before creating the desktop window
    OleInit usingCOM;

    // init common controls library
    CommonControlInit usingCmnCtrl;

    g_Globals.read_persistent();

    if (startup_desktop) {
        WaitCursor wait;

        g_Globals._desktops.init();

        g_Globals._hwndDesktop = DesktopWindow::Create();
#ifdef _USE_HDESK
        g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
#endif
    }

    if (_tcsstr(ext_options,TEXT("-?"))) {
        MessageBoxA(g_Globals._hwndDesktop,
            "/e        open cabinet window in explorer mode\r\n"
            "/root        open cabinet window in rooted mode\r\n"
            "/mdi        open cabinet window in MDI mode\r\n"
            "/sdi        open cabinet window in SDI mode\r\n"
            "\r\n"
            "-?        display command line options\r\n"
            "\r\n"
            "-desktop        start in desktop mode regardless of an already running shell\r\n"
            "-nodesktop    disable desktop mode\r\n"
            "-explorer        display cabinet window regardless of enabled desktop mode\r\n"
            "\r\n"
            "-install        replace previous shell application with ROS Explorer\r\n"
            "\r\n"
            "-noautostart    disable autostarts\r\n"
            "-autostart    enable autostarts regardless of debug build\r\n"
            "\r\n"
            "-console        open debug console\r\n"
            "\r\n"
            "-debug        activate GDB remote debugging stub\r\n"
            "-break        activate debugger breakpoint\r\n",
            "ROS Explorer - command line options", MB_OK);
    }

    Thread* pSSOThread = NULL;

    if (startup_desktop) {
        // launch SSO thread to allow message processing independent from the explorer main thread
        pSSOThread = new SSOThread;
        pSSOThread->Start();
    }

    /**TODO launching autostart programs can be moved into a background thread. */
    if (autostart) {
        const char* argv[] = {"", "s"};    // call startup routine in SESSION_START mode
        startup(2, argv);
    }

#ifndef ROSSHELL
    if (g_Globals._hwndDesktop)
        g_Globals._desktop_mode = true;
#endif


    int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);


    // write configuration file
    g_Globals.write_persistent();

    if (pSSOThread) {
        pSSOThread->Stop();
        delete pSSOThread;
    }

    if (!any_desktop_running) {
        // shutdown the shell DDE server
        if (g_SHDOCVW_ShellDDEInit)
            (*g_SHDOCVW_ShellDDEInit)(FALSE);
    }

    return ret;
}
开发者ID:darkvaderXD2014,项目名称:reactos,代码行数:101,代码来源:explorer.cpp


注:本文中的Thread::Stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。