本文整理汇总了C++中MyThread::wait方法的典型用法代码示例。如果您正苦于以下问题:C++ MyThread::wait方法的具体用法?C++ MyThread::wait怎么用?C++ MyThread::wait使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyThread
的用法示例。
在下文中一共展示了MyThread::wait方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MyThread mThread;
mThread.start();
mThread.wait();
qDebug() << "Done!";
return a.exec();
}
示例2: run_main
int run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Log_Thread_Inheritance_Test"));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) - in run_main()\n"));
ACE_DEBUG ((LM_DEBUG, "(%P|%t) - this test will crash ACE if it does not "
"have the fix for bug #3480.\n"));
ACE_OSTREAM_TYPE *initial_stream = ACE_LOG_MSG->msg_ostream ();
MyThread mt (true);
mt.activate ();
mt.wait ();
MyThread::childthread_.wait ();
ACE_LOG_MSG->msg_ostream (initial_stream, 0);
#ifdef ACE_HAS_PTHREADS
if (!test_inherited_attributes ()) return -1;
#endif /* ACE_HAS_PTHREADS */
ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Test passed.\n"));
ACE_END_TEST;
return 0;
}
示例3: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MyThread mThread;
qDebug()<<"GUI thread before MyThread start()"
<<a.thread()->currentThread();
qDebug()<<"GUI thread after start()"
<<a.thread()->currentThread();
mThread.start();
mThread.wait();
qDebug()<<"GUI thread after wait()"
<<a.thread()->currentThread();
return a.exec();
}