Clean up JobQueue for new Workers

This commit is contained in:
Vinnie Falco
2013-07-29 14:00:56 -07:00
parent ced191c195
commit cd452aa870
3 changed files with 66 additions and 138 deletions

View File

@@ -10,6 +10,8 @@
class JobQueue : private Workers::Callback
{
public:
typedef std::map<JobType, std::pair<int, int > > JobCounts;
JobQueue ();
~JobQueue ();
@@ -48,25 +50,17 @@ public:
Json::Value getJson (int c = 0);
private:
void threadEntry ();
bool getJob (Job& job);
void processTask ();
private:
Workers m_workers;
boost::mutex mJobLock;
boost::condition_variable mJobCond;
uint64 mLastJob;
std::set <Job> mJobSet;
LoadMonitor mJobLoads [NUM_JOB_TYPES];
int mThreadCount;
bool mShuttingDown;
std::map<JobType, std::pair<int, int > > mJobCounts;
bool getJob (Job& job);
boost::mutex mJobLock; // VFALCO TODO Replace with CriticalSection
uint64 mLastJob;
std::set <Job> mJobSet;
LoadMonitor mJobLoads [NUM_JOB_TYPES];
JobCounts mJobCounts;
};
#endif