Ref T541 Abandoned worker shouldn't interrupt if it's in the owner's thread.

This commit is contained in:
Mat Sutcliffe
2019-02-18 15:50:11 +00:00
parent 5de96382bc
commit 7b4d3874a6

View File

@@ -114,18 +114,19 @@ namespace BlackMisc
void CWorkerBase::abandon() noexcept
{
thread()->requestInterruption();
if (thread() != thread()->thread()) { thread()->requestInterruption(); }
quit();
}
void CWorkerBase::abandonAndWait() noexcept
{
thread()->requestInterruption();
if (thread() != thread()->thread()) { thread()->requestInterruption(); }
quitAndWait();
}
bool CWorkerBase::isAbandoned() const
{
Q_ASSERT(thread() == QThread::currentThread());
return thread()->isInterruptionRequested();
}