Cleanups.

This commit is contained in:
JoelKatz
2012-10-29 16:20:19 -07:00
parent 1c7a7b2dc2
commit 4c4a9b168f
2 changed files with 10 additions and 1 deletions

View File

@@ -70,6 +70,14 @@ void JobQueue::addJob(JobType type, const boost::function<void(void)>& jobFunc)
}
int JobQueue::getJobCount(JobType t)
{
boost::mutex::scoped_lock sl(mJobLock);
std::map<JobType, int>::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;

View File

@@ -70,7 +70,8 @@ public:
void addJob(JobType type, const boost::function<void(void)>& 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<JobType, int> > getJobCounts();
void shutdown();