读书人

QT反复开启同一个线程的有关问题

发布时间: 2012-04-22 18:34:46 作者: rapoo

QT反复开启同一个线程的问题
当使用start函数启动线程run之后,如果run线程里的程序没有运行完就再次使用start函数开启同一个run线程,那我想请问上一次的run线程会出现什么样的结果,是被打断还是等继续运行完之后再执行第二次调用?

[解决办法]
void QThread::start ( Priority priority = InheritPriority ) [slot]
Begins execution of the thread by calling run(), which should be reimplemented in a QThread subclass to contain your code. The operating system will schedule the thread according to the priority parameter. If the thread is already running, this function does nothing.

读书人网 >QT开发

热点推荐