Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

void copyThread::stopTheCopy (  ) [slot]

Query for stop the current thread.

For stop in urgence the copy thread, use only with cancel!

See also:
stopIt, run() and stop()

Note:
never do the unlock() of mutex here, cause crash because it need by close by the opener thread

Definition at line 937 of file CopyThread.cpp.

References MultiThread_ThreadList, stopIt, theCurrentStat, and theWriteThreadList.

Referenced by Main_window::cancel_copy_window(), checkIfNeedWaitOneWriteThread(), errorAction(), fileExistsAction(), flush(), stop(), ~copyThread(), and Main_window::~Main_window().

{
      /// \note never do the unlock() of mutex here, cause crash because it need by close by the opener thread
      DEBUGCONSOLE(50,"copyThread::stopTheCopy","stopTheCopy");
      stopIt=true;

      if(theCurrentStat!=copyThread::Stopped)
      {
            QMutexLocker lock_mutex(&MultiThread_ThreadList);
            for (int i = 0; i < theWriteThreadList.size(); ++i) {
                  theWriteThreadList.at(i)->stop();
            }
      }
      DEBUGCONSOLE(90,"copyThread::stopTheCopy","this->isRunning(): true");
      while(waitAction.available()<=0)
            waitAction.release();
      waitAction.acquire();
      while(waitNewClockForSpeed.available()<=0)
            waitNewClockForSpeed.release();
      waitNewClockForSpeed.acquire();
      DEBUGCONSOLE(90,"copyThread::stopTheCopy","stop done");
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index