Results 1 to 2 of 2

Thread: thread implementing and stopping the thread

  1. #1
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default thread implementing and stopping the thread

    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
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: thread implementing and stopping the thread

    Please do not start new threads again and again on the same subject.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    santosh.kumar (14th May 2007)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.