Beispiel #1
0
int main(int argc, char *argv[])
{
	QCoreApplication a(argc, argv);

	MyThread mThread;
	mThread.start();

	mThread.wait();
	qDebug() << "Done!";

	return a.exec();
}
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;
}
Beispiel #3
0
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();
}