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:
Mat Sutcliffe
2018-10-24 22:34:06 +01:00
committed by Klaus Basan
parent 00c5e989d2
commit cf5a807bc6

View File

@@ -170,6 +170,7 @@ namespace BlackMisc
void aboutToStart();
//! 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();
protected:
@@ -188,7 +189,6 @@ namespace BlackMisc
{
QMutexLocker lock(&m_finishedMutex);
m_finished = true;
lock.unlock();
emit finished();
}