| Цитата | void QThread::terminate () [slot]
Terminates the execution of the thread. The thread may or may not be terminated immediately, depending on the operating systems scheduling policies. Use QThread::wait() after terminate() for synchronous termination.
When the thread is terminated, all threads waiting for the thread to finish will be woken up.
Warning: This function is dangerous and its use is discouraged. The thread can be terminated at any point in its code path. Threads can be terminated while modifying data. There is no chance for the thread to clean up after itself, unlock any held mutexes, etc. In short, use this function only if absolutely necessary.
Termination can be explicitly enabled or disabled by calling QThread::setTerminationEnabled(). Calling this function while termination is disabled results in the termination being deferred, until termination is re-enabled. See the documentation of QThread::setTerminationEnabled() for more information. |
Добавлено через 3 минуты и 35 секунд
Цитата(daemonaz @ 31.1.2013, 10:30 ) | | там и зависает.. |
варианты, перед вызовом stop() ты захватил мьютекс. Поток перед вызовом стоп тоже встал на этот мьютекс. После terminate() идет wait(), который ждет завершения потока, который висит на мьютексе. Или другой вариант - поток завис до этого на системном вызове... |