本文整理汇总了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);
}
示例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);
}
示例3: stop
void stop(int sig)
{
if (!die) {
die = true;
comm->stop();
monitorThreads.interrupt_all();
}
}
示例4:
virtual ~Log()
{
_isStopping = true;
_threadPool.interrupt_all();
_threadPool.join_all();
_stringLoggerThread.interrupt();
_stringLoggerThread.join();
}
示例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);
}
示例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
}
示例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);
}
示例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);
}
示例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();
}
示例10:
~Threadpool() {
Logger::pLOG->info("Delete threadpool of DOR");
_tg.interrupt_all();
_tg.join_all();
}
示例11:
void M6Processor::Error(exception_ptr e)
{
mException = e;
mFileThreads.interrupt_all();
mDocThreads.interrupt_all();
}