public class MyThread extends Thread{ private static int ticket=100; public void run(){ for(int i=0;i<50;i++) if(ticket>0) System.out.println(Thread.currentThread().getName()+"正在卖第"+(ticket--)+"张票"); } //main函数是一个主线程 public stati…
一.定时器QTimer类 The QTimer class provides repetitive and single-shot timers. The QTimer class provides a high-level programming interface for timers. To use it, create a QTimer, connect its timeout() signal to the appropriate slots, and call start(). Fr…
线程之间共享数据,但又单独执行: QT线程QThread是平台无关的: 通常主线程从main开始执行,而在主线程中创建其他线程,其他线程派生于QThread: 1.线程优先级 总共8个优先级:线程优先级从上到下越来越高. Constant Value Description QThread::IdlePriority 0 scheduled only when no other threads are running. QThread::LowestPriority 1 scheduled…