mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Remove obsolete JobQueue thread tracking
This commit is contained in:
@@ -92,10 +92,6 @@ public:
|
|||||||
// Cannot be const because LoadMonitor has no const methods.
|
// Cannot be const because LoadMonitor has no const methods.
|
||||||
bool isOverloaded ();
|
bool isOverloaded ();
|
||||||
|
|
||||||
/** Get the Job corresponding to a thread. If no thread, use the current
|
|
||||||
thread. */
|
|
||||||
Job* getJobForThread(std::thread::id const& id = {}) const;
|
|
||||||
|
|
||||||
// Cannot be const because LoadMonitor has no const methods.
|
// Cannot be const because LoadMonitor has no const methods.
|
||||||
Json::Value getJson (int c = 0);
|
Json::Value getJson (int c = 0);
|
||||||
|
|
||||||
@@ -109,8 +105,6 @@ private:
|
|||||||
JobDataMap m_jobData;
|
JobDataMap m_jobData;
|
||||||
JobTypeData m_invalidJobData;
|
JobTypeData m_invalidJobData;
|
||||||
|
|
||||||
std::map <std::thread::id, Job*> m_threadIds;
|
|
||||||
|
|
||||||
// The number of jobs currently in processTask()
|
// The number of jobs currently in processTask()
|
||||||
int m_processCount;
|
int m_processCount;
|
||||||
|
|
||||||
|
|||||||
@@ -305,16 +305,6 @@ JobQueue::getJson (int c)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Job*
|
|
||||||
JobQueue::getJobForThread (std::thread::id const& id) const
|
|
||||||
{
|
|
||||||
auto tid = (id == std::thread::id()) ? std::this_thread::get_id() : id;
|
|
||||||
|
|
||||||
std::lock_guard <std::mutex> lock (m_mutex);
|
|
||||||
auto i = m_threadIds.find (tid);
|
|
||||||
return (i == m_threadIds.end()) ? nullptr : i->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
JobTypeData&
|
JobTypeData&
|
||||||
JobQueue::getJobTypeData (JobType type)
|
JobQueue::getJobTypeData (JobType type)
|
||||||
{
|
{
|
||||||
@@ -400,8 +390,6 @@ JobQueue::getNextJob (Job& job)
|
|||||||
job = *iter;
|
job = *iter;
|
||||||
m_jobSet.erase (iter);
|
m_jobSet.erase (iter);
|
||||||
|
|
||||||
m_threadIds[std::this_thread::get_id()] = &job;
|
|
||||||
|
|
||||||
--data.waiting;
|
--data.waiting;
|
||||||
++data.running;
|
++data.running;
|
||||||
}
|
}
|
||||||
@@ -422,10 +410,6 @@ JobQueue::finishJob (JobType type)
|
|||||||
m_workers.addTask ();
|
m_workers.addTask ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! m_threadIds.erase (std::this_thread::get_id()))
|
|
||||||
{
|
|
||||||
assert (false);
|
|
||||||
}
|
|
||||||
--data.running;
|
--data.running;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,8 +237,6 @@ ServerHandlerImp::processRequest (Port const& port,
|
|||||||
std::string forwardedFor, std::string user)
|
std::string forwardedFor, std::string user)
|
||||||
{
|
{
|
||||||
auto rpcJ = app_.journal ("RPC");
|
auto rpcJ = app_.journal ("RPC");
|
||||||
// Move off the webserver thread onto the JobQueue.
|
|
||||||
assert (app_.getJobQueue().getJobForThread());
|
|
||||||
|
|
||||||
Json::Value jsonRPC;
|
Json::Value jsonRPC;
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user