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


C++ thread_group::interrupt_all方法代码示例

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


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

示例1: make_tuple

std::tuple<bool, boost::thread*> RunSharkfund(int argc, char* argv[])
{
	boost::thread* detectShutdownThread = NULL;
	static boost::thread_group threadGroup;
	SetupEnvironment();

	bool fRet = false;

	// Connect Dacrsd signal handlers
	noui_connect();

	fRet = AppInit(argc, argv,threadGroup);

	detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup));

	if (!fRet) {
		if (detectShutdownThread)
			detectShutdownThread->interrupt();

		threadGroup.interrupt_all();

		// threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of
		// the startup-failure cases to make sure they don't result in a hang due to some
		// thread-blocking-waiting-for-another-thread-during-startup case
	}
  return std::make_tuple (fRet,detectShutdownThread);
}
开发者ID:sharkfund001,项目名称:sharkfund,代码行数:27,代码来源:sharkfundd.cpp

示例2:

    ~TestingSetup()
    {
        threadGroup.interrupt_all();
        threadGroup.join_all();
        Bitcredit_UnregisterNodeSignals(Credits_NetParams()->GetNodeSignals());
#ifdef ENABLE_WALLET
        delete bitcoin_pwalletMain;
        bitcoin_pwalletMain = NULL;
        delete bitcredit_pwalletMain;
        bitcredit_pwalletMain = NULL;
        delete deposit_pwalletMain;
        deposit_pwalletMain = NULL;
#endif
        delete credits_pcoinsTip;
        delete bitcredit_pcoinsdbview;
        delete bitcredit_pblocktree;

        delete bitcoin_pcoinsTip;
        delete bitcoin_pcoinsdbview;
        delete bitcoin_pblocktree;
#ifdef ENABLE_WALLET
        bitcoin_bitdb.Flush(true);
        bitcredit_bitdb.Flush(true);
        deposit_bitdb.Flush(true);
#endif
        boost::filesystem::remove_all(pathTemp);
    }
开发者ID:credits-currency,项目名称:credits,代码行数:27,代码来源:test_credits.cpp

示例3: stop

void stop(int sig)
{
	if (!die) {
		die = true;
		comm->stop();
		monitorThreads.interrupt_all();
	}
}
开发者ID:hans511002,项目名称:erydb,代码行数:8,代码来源:slavenode.cpp

示例4:

 virtual ~Log()
 {
     _isStopping = true;
     _threadPool.interrupt_all();
     _threadPool.join_all();
     _stringLoggerThread.interrupt();
     _stringLoggerThread.join();
 }
开发者ID:ankithbti,项目名称:fitiedCoreCpp,代码行数:8,代码来源:Log.hpp

示例5:

 ~TestingSetup()
 {
     threadGroup.interrupt_all();
     threadGroup.join_all();
     delete pwalletMain;
     pwalletMain = NULL;
     delete pcoinsTip;
     delete pcoinsdbview;
     delete pblocktree;
     bitdb.Flush(true);
     boost::filesystem::remove_all(pathTemp);
 }
开发者ID:ColoradoPay,项目名称:CPAY,代码行数:12,代码来源:test_bitcoin.cpp

示例6: stop

void cia_client::stop()
{
	if (!m_started_) return;
	m_started_ = false;
	m_sock_.close();
	m_deal_ch_msg_group.interrupt_all();

	ptr self = shared_from_this();
	auto it = std::find(clients.begin(), clients.end(), self);
	clients.erase(it);
	BOOST_LOG_SEV(cia_g_logger, Debug) << "客户端socket已经调用stop函数关闭";
	//x m_config_server->set_started(true);	// 为了防止网络情况异常, 造成服务端关闭连接后重置此值为2, 通讯端保证此值为1
}
开发者ID:ciaapp,项目名称:CIACommunicationServerV2,代码行数:13,代码来源:cia_client.hpp

示例7: UnregisterNodeSignals

    ~TestingSetup()
    {
        threadGroup.interrupt_all();
        threadGroup.join_all();
        UnregisterNodeSignals(GetNodeSignals());
#ifdef ENABLE_WALLET
        delete pwalletMain;
        pwalletMain = NULL;
#endif
        delete pblocktree;
	delete pviewTip;
#ifdef ENABLE_WALLET
        bitdb.Flush(true);
#endif
        boost::filesystem::remove_all(pathTemp);
    }
开发者ID:JacobBruce,项目名称:Cryptonite,代码行数:16,代码来源:test_bitcoin.cpp

示例8: make_tuple

std::tuple<bool, boost::thread*> RunDacrs(int argc, char* argv[]) {
	boost::thread* detectShutdownThread = NULL;
	static boost::thread_group threadGroup;
	SetupEnvironment();

	bool fRet = false;

	// Connect Dacrsd signal handlers
	noui_connect();

	fRet = AppInit(argc, argv, threadGroup);

	detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup));

	if (!fRet) {
		if (detectShutdownThread)
			detectShutdownThread->interrupt();

		threadGroup.interrupt_all();
	}
	return std::make_tuple(fRet, detectShutdownThread);
}
开发者ID:hdczsf,项目名称:dacrs,代码行数:22,代码来源:systestbase.cpp

示例9: waitTermination

void waitTermination( boost::thread_group& threads, std::initializer_list< int > signals = { SIGINT, SIGTERM, SIGQUIT } )
{
     sigset_t sset;

     sigemptyset( &sset );

     for( const auto each: signals )
     {
          sigaddset( &sset, each );
     }

     sigprocmask( SIG_BLOCK, &sset, nullptr );

     std::cout << "threads running: " << threads.size() << "; main thread waiting for termination signals...\n";

     int sig = 0;
     sigwait( &sset, &sig );

     std::cout << "termination signal " << sig << " has been caught\n" << "interrupting threads...\n";

     threads.interrupt_all();
}
开发者ID:alexen,项目名称:using_rabbitmq,代码行数:22,代码来源:main.cpp

示例10:

 ~Threadpool() {
     Logger::pLOG->info("Delete threadpool of DOR");
     _tg.interrupt_all();
     _tg.join_all();
 }
开发者ID:AbstractStateMachine,项目名称:concept,代码行数:5,代码来源:dataobjectreactor.hpp

示例11:

void M6Processor::Error(exception_ptr e)
{
    mException = e;
    mFileThreads.interrupt_all();
    mDocThreads.interrupt_all();
}
开发者ID:cmbi,项目名称:mrs,代码行数:6,代码来源:M6Builder.cpp


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