Merge branch 'develop' into pr/1113

This commit is contained in:
Alex Fabijanic 2016-03-09 19:56:37 -08:00
commit 84c2c5ea78
2 changed files with 5 additions and 4 deletions

View File

@ -86,7 +86,7 @@ public:
TaskList taskList() const; TaskList taskList() const;
/// Returns a copy of the internal task list. /// Returns a copy of the internal task list.
int count() const; std::size_t count() const;
/// Returns the number of tasks in the internal task list. /// Returns the number of tasks in the internal task list.
void addObserver(const AbstractObserver& observer); void addObserver(const AbstractObserver& observer);
@ -125,11 +125,11 @@ private:
// //
// inlines // inlines
// //
inline int TaskManager::count() const inline std::size_t TaskManager::count() const
{ {
FastMutex::ScopedLock lock(_mutex); FastMutex::ScopedLock lock(_mutex);
return (int) _taskList.size(); return _taskList.size();
} }

View File

@ -115,11 +115,12 @@ void TaskManager::taskStarted(Task* pTask)
void TaskManager::taskProgress(Task* pTask, float progress) void TaskManager::taskProgress(Task* pTask, float progress)
{ {
FastMutex::ScopedLock lock(_mutex); ScopedLockWithUnlock<FastMutex> lock(_mutex);
if (_lastProgressNotification.isElapsed(MIN_PROGRESS_NOTIFICATION_INTERVAL)) if (_lastProgressNotification.isElapsed(MIN_PROGRESS_NOTIFICATION_INTERVAL))
{ {
_lastProgressNotification.update(); _lastProgressNotification.update();
lock.unlock();
_nc.postNotification(new TaskProgressNotification(pTask, progress)); _nc.postNotification(new TaskProgressNotification(pTask, progress));
} }
} }