fix transit hop job queuing

This commit is contained in:
Jeff Becker 2020-06-04 15:47:28 -04:00
parent bb14b44bcf
commit fe1dae8f30
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 10 additions and 10 deletions

View File

@ -252,11 +252,11 @@ namespace llarp
{
if (m_UpstreamQueue && not m_UpstreamQueue->empty())
{
if (r->threadpool()->addJob(std::bind(
&TransitHop::UpstreamWork, shared_from_this(), std::move(m_UpstreamQueue), r)))
{
m_UpstreamWorkCounter++;
}
m_UpstreamWorkCounter++;
r->threadpool()->addJob([self = shared_from_this(),
data = std::move(m_UpstreamQueue),
r]() { self->UpstreamWork(data, r); });
}
m_UpstreamQueue = nullptr;
}
@ -266,11 +266,11 @@ namespace llarp
{
if (m_DownstreamQueue && not m_DownstreamQueue->empty())
{
if (r->threadpool()->addJob(std::bind(
&TransitHop::DownstreamWork, shared_from_this(), std::move(m_DownstreamQueue), r)))
{
m_DownstreamWorkCounter++;
}
m_DownstreamWorkCounter++;
r->threadpool()->addJob([self = shared_from_this(),
data = std::move(m_UpstreamQueue),
r]() { self->DownstreamWork(data, r); });
}
m_DownstreamQueue = nullptr;
}