Changeset View
Changeset View
Standalone View
Standalone View
src/scheduler.cpp
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | CScheduler::getQueueInfo(boost::chrono::system_clock::time_point &first, | ||||
if (!taskQueue.empty()) { | if (!taskQueue.empty()) { | ||||
first = taskQueue.begin()->first; | first = taskQueue.begin()->first; | ||||
last = taskQueue.rbegin()->first; | last = taskQueue.rbegin()->first; | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
bool CScheduler::AreThreadsServicingQueue() const { | bool CScheduler::AreThreadsServicingQueue() const { | ||||
boost::unique_lock<boost::mutex> lock(newTaskMutex); | |||||
return nThreadsServicingQueue; | return nThreadsServicingQueue; | ||||
} | } | ||||
void SingleThreadedSchedulerClient::MaybeScheduleProcessQueue() { | void SingleThreadedSchedulerClient::MaybeScheduleProcessQueue() { | ||||
{ | { | ||||
LOCK(m_cs_callbacks_pending); | LOCK(m_cs_callbacks_pending); | ||||
// Try to avoid scheduling too many copies here, but if we | // Try to avoid scheduling too many copies here, but if we | ||||
// accidentally have two ProcessQueue's scheduled at once its | // accidentally have two ProcessQueue's scheduled at once its | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |