diff --git a/src/JobQueue.cpp b/src/JobQueue.cpp index 40ab89483..7cf6456b0 100644 --- a/src/JobQueue.cpp +++ b/src/JobQueue.cpp @@ -70,6 +70,14 @@ void JobQueue::addJob(JobType type, const boost::function& jobFunc) } int JobQueue::getJobCount(JobType t) +{ + boost::mutex::scoped_lock sl(mJobLock); + + std::map::iterator c = mJobCounts.find(t); + return (c == mJobCounts.end()) ? 0 : c->second; +} + +int JobQueue::getJobCountGE(JobType t) { // return the number of jobs at this priority level or greater int ret = 0; diff --git a/src/JobQueue.h b/src/JobQueue.h index 48211cfb4..866b149d4 100644 --- a/src/JobQueue.h +++ b/src/JobQueue.h @@ -70,7 +70,8 @@ public: void addJob(JobType type, const boost::function& job); - int getJobCount(JobType t); // All jobs at or greater than this priority + int getJobCount(JobType t); // Jobs at this priority + int getJobCountGE(JobType t); // All jobs at or greater than this priority std::vector< std::pair > getJobCounts(); void shutdown();