Hi,
How are you doing?
This is a relatively simple threading problem. I have a main thread where child thread were created and run called:
@dcc = new DetectClassifyComputation();
connect(dcc,SIGNAL(data_ready()),this,SLOT(plot_processed_samples()),Qt::QueuedConnection);
....
dcc->updatePDParameters(this->samples_to_process,&pks,&pks_ind,this->smpl_rate,stng.getUi()->spinBox_det_ratio->value()*0.1);
cout<<"before starting new thread "<<endl;
dcc->setStackSize(100000);
dcc->start(QThread::HighPriority);
cout<<"after starting new thread "<<endl;
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
this->setEnabled(false);
cout<<"PREPROCESS 6. "<<endl;
while(!dcc->isFinished())
{
QApplication::processEvents();
}
this->setEnabled(true);
QApplication::restoreOverrideCursor();
cout<<"END OF PREPROCESS "<<endl;
where dcc is the instance of the thread class. The signal is defined in the thread class as:
Q_SIGNALS:
void data_ready();
I observe, that MainWindow where I call the run of the thread “hangs” ( “freezes”) after some time ( on third or second run of the thread ) with exception code c0000005. That is on Windows 7 and the program fails.
It seems once the slot can’t be invoked.
My question is what is the problem? How to fix that?
Thank you in advance in any help with this issue.
↧