【发布时间】:2023-04-09 00:22:01
【问题描述】:
我在类文件中有一个读写函数。该类继承QThread类并覆盖run,没有信号和槽,它基本上在一个线程中运行数据处理函数。在它的构造函数中是方法movetothread(this)。要有两个函数来组成队列并实现多线程,
我可以在 write 函数中调用movetothread(secondthread) 吗?
void write(args)
{
movetothread(secondthread);
}
使写入函数在单独的线程上运行。 写入功能如何以及何时停止?
【问题讨论】:
-
我发现 permalink.gmane.org/gmane.comp.lib.qt.general/38137 关于 movetothread(this)
标签: c++ multithreading qt function qthread