C++ (Qt)QReadWriteLock lock; void WriterThreadN::run() { ... lock.lockForWrite(); write_file(); lock.unlock(); ... }
C++ (Qt)void MainThread::resultSlot(QString &result){ QStandardItem *itemResult = new QStandardItem(result); model->appendRow(itemResult); // model->insertRow(0);// model->setData(model->index(0, 0), result);}
C++ (Qt)void MainThread::resultSlot(QString &result){ // QMutex mutex; // объявлю в .h mutex.lock(); QStandardItem *itemResult = new QStandardItem(result); model->appendRow(itemResult); mutex.unlock(); // model->insertRow(0);// model->setData(model->index(0, 0), result);}
C++ (Qt)void BeelinerThread::run(){ //qDebug() << "Thread" << iter << QObject::thread(); QMutex mutex;
void BeelinerThread::run()