fix comment; don't send TaskProgressNotification if progress does not change

Conflicts:
	Foundation/src/Task.cpp
This commit is contained in:
Guenter Obiltschnig
2016-02-13 20:22:02 +01:00
parent eb2861ddee
commit 2522aefaf0
2 changed files with 7 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ private:
class Foundation_API TaskProgressNotification: public TaskNotification class Foundation_API TaskProgressNotification: public TaskNotification
/// This notification is posted by the TaskManager for /// This notification is posted by the TaskManager for
/// every task that has failed with an exception. /// a task when its progress changes.
{ {
public: public:
TaskProgressNotification(Task* pTask, float progress); TaskProgressNotification(Task* pTask, float progress);

View File

@@ -95,9 +95,12 @@ void Task::setProgress(float progress)
{ {
FastMutex::ScopedLock lock(_mutex); FastMutex::ScopedLock lock(_mutex);
_progress = progress; if (_progress != taskProgress)
{
_progress = taskProgress;
if (_pOwner) if (_pOwner)
_pOwner->taskProgress(this, _progress); _pOwner->taskProgress(this, _progress);
}
} }