mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T541 Abandoned worker shouldn't interrupt if it's in the owner's thread.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user