PDA

View Full Version : thread implementing and stopping the thread



santosh.kumar
14th May 2007, 13:36
hi

i m implementing and stopping the thread..but it is not working properly..
thread is not stopping properly...
check where i have done the mistake in following code....

QDirThread:: QDirThread(QObject*parent):QThread(parent)
{
m_bAbort = false;
}
QDirThread::~ QDirThread()
{
m_bAbort = true;
}
void QDirThread::run()
{
if(!m_bAbort)
{
DirView(strPath);
}
else
return;
}
void QDirThread::dirViewSleep()
{
usleep(25000);
}
void QDirThread::stop()
{
m_bAbort = true;
}
void QDirThread:irView(QString strPath)
{
//recursivly loading directory
}

jpn
14th May 2007, 13:53
Please do not start new threads again and again on the same subject.

http://www.qtcentre.org/forum/f-qt-programming-2/t-stop-the-thread-during-recursivly-loading-directory-7025.html
http://www.qtcentre.org/forum/f-qt-programming-2/t-stop-the-thread-7020.html