diff options
author | arnova <arnova@void.org> | 2013-03-04 09:53:54 +0100 |
---|---|---|
committer | arnova <arnova@void.org> | 2013-03-04 10:18:52 +0100 |
commit | 923498210e0d9acb7d1cdb7d8b8ad8a168bcd9b5 (patch) | |
tree | 393728353a2154c623313cd6b5681bab2af4e40b | |
parent | 1d05490c7cd97936bda8320d305e67fd38478ae3 (diff) |
removed: Obsolete job pausedType pause/unpause functions
-rw-r--r-- | xbmc/utils/JobManager.cpp | 53 | ||||
-rw-r--r-- | xbmc/utils/JobManager.h | 34 |
2 files changed, 0 insertions, 87 deletions
diff --git a/xbmc/utils/JobManager.cpp b/xbmc/utils/JobManager.cpp index 9aaa06b02a..f389ebf25a 100644 --- a/xbmc/utils/JobManager.cpp +++ b/xbmc/utils/JobManager.cpp @@ -272,10 +272,6 @@ CJob *CJobManager::PopJob() if (m_jobQueue[priority].size() && m_processing.size() < GetMaxWorkers(CJob::PRIORITY(priority))) { - // skip adding any paused types - if (!SkipPausedJobs((CJob::PRIORITY)priority)) - return NULL; - // pop the job off the queue CWorkItem job = m_jobQueue[priority].front(); m_jobQueue[priority].pop_front(); @@ -289,23 +285,6 @@ CJob *CJobManager::PopJob() return NULL; } -void CJobManager::Pause(const std::string &pausedType) -{ - CSingleLock lock(m_section); - // just push it in so we get ref counting, - // the queue will resume when all Pause requests - // for a given type have been UnPaused. - m_pausedTypes.push_back(pausedType); -} - -void CJobManager::UnPause(const std::string &pausedType) -{ - CSingleLock lock(m_section); - std::vector<std::string>::iterator i = find(m_pausedTypes.begin(), m_pausedTypes.end(), pausedType); - if (i != m_pausedTypes.end()) - m_pausedTypes.erase(i); -} - void CJobManager::Pause(const CJob::PRIORITY &priority) { CSingleLock lock(m_section); @@ -336,38 +315,6 @@ bool CJobManager::IsProcessing(const CJob::PRIORITY &priority) const return false; } -bool CJobManager::IsPaused(const std::string &pausedType) -{ - CSingleLock lock(m_section); - std::vector<std::string>::iterator i = find(m_pausedTypes.begin(), m_pausedTypes.end(), pausedType); - return (i != m_pausedTypes.end()); -} - -bool CJobManager::SkipPausedJobs(CJob::PRIORITY priority) -{ - if (priority > CJob::PRIORITY_LOW) - return true; - - // find the first unpaused job - JobQueue::iterator first_job = m_jobQueue[priority].begin(); - for (; first_job != m_jobQueue[priority].end(); ++first_job) - { - std::vector<std::string>::iterator i = find(m_pausedTypes.begin(), m_pausedTypes.end(), first_job->m_job->GetType()); - if (i == m_pausedTypes.end()) - break; // found a job that can be performed - } - if (first_job == m_jobQueue[priority].end()) - return false; // no jobs ready to go - - // shunt all the paused ones to the back of the queue - for (JobQueue::iterator i = m_jobQueue[priority].begin(); i != first_job; i++) - { - m_jobQueue[priority].push_back(*i); - m_jobQueue[priority].pop_front(); - } - return true; -} - int CJobManager::IsProcessing(const std::string &pausedType) { int jobsMatched = 0; diff --git a/xbmc/utils/JobManager.h b/xbmc/utils/JobManager.h index 141806ed19..7ab225f04e 100644 --- a/xbmc/utils/JobManager.h +++ b/xbmc/utils/JobManager.h @@ -227,31 +227,6 @@ public: void CancelJobs(); /*! - \brief Suspends queueing of the specified type until unpaused - Useful to (for ex) stop queuing thumb jobs during video playback. Only affects PRIORITY_LOW or lower. - Does not affect currently processing jobs, use IsProcessing to see if any need to be waited on - Types accumulate, so more than one can be set at a time. - Refcounted, so UnPause() must be called once for each Pause(). - \param pausedType only jobs of this type will be affected - \sa UnPause(), IsPaused(), IsProcessing() - */ - void Pause(const std::string &pausedType); - - /*! - \brief Resumes queueing of the specified type - \param pausedType only jobs of this type will be affected - \sa Pause(), IsPaused(), IsProcessing() - */ - void UnPause(const std::string &pausedType); - - /*! - \brief Checks if jobs of specified type are paused. - \param pausedType only jobs of this type will be affected - \sa Pause(), UnPause(), IsProcessing() - */ - bool IsPaused(const std::string &pausedType); - - /*! \brief Checks to see if any jobs of a specific type are currently processing. \param pausedType Job type to search for \return Number of matching jobs @@ -337,14 +312,6 @@ private: void RemoveWorker(const CJobWorker *worker); unsigned int GetMaxWorkers(CJob::PRIORITY priority) const; - /*! \brief skips over any paused jobs of given priority. - Moves any paused jobs at the front of the queue to the back of the - queue, allowing unpaused jobs to continue processing. - \param priority the priority queue to consider. - \return true if an unpaused job is available, false if no unpaused jobs are available. - */ - bool SkipPausedJobs(CJob::PRIORITY priority); - unsigned int m_jobCounter; typedef std::deque<CWorkItem> JobQueue; @@ -359,5 +326,4 @@ private: CCriticalSection m_section; CEvent m_jobEvent; bool m_running; - std::vector<std::string> m_pausedTypes; }; |