mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Ref T405 Follow-up: mutex needs to remain locked when signal is emitted,
to guarantee continuations are called only once when worker finishes.
This commit is contained in:
committed by
Klaus Basan
parent
00c5e989d2
commit
cf5a807bc6
@@ -170,6 +170,7 @@ namespace BlackMisc
|
|||||||
void aboutToStart();
|
void aboutToStart();
|
||||||
|
|
||||||
//! Emitted when the task is finished.
|
//! Emitted when the task is finished.
|
||||||
|
//! \note Slots connected to this signal may not call any methods that observe the worker's finished flag.
|
||||||
void finished();
|
void finished();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -188,7 +189,6 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
QMutexLocker lock(&m_finishedMutex);
|
QMutexLocker lock(&m_finishedMutex);
|
||||||
m_finished = true;
|
m_finished = true;
|
||||||
lock.unlock();
|
|
||||||
emit finished();
|
emit finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user