mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 01:37:00 +00:00
@@ -212,7 +212,6 @@ public:
|
||||
BEAST_EXPECT(shouldStop.has_value() && *shouldStop == true);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ JobQueue::Coro::Coro(
|
||||
yield();
|
||||
if (!shouldStop())
|
||||
{
|
||||
fn(shared_from_this());
|
||||
fn(shared_from_this());
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
finished_ = true;
|
||||
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
class Coro : public std::enable_shared_from_this<Coro>
|
||||
{
|
||||
friend class JobQueue;
|
||||
|
||||
private:
|
||||
detail::LocalValues lvs_;
|
||||
JobQueue& jq_;
|
||||
@@ -286,9 +287,12 @@ private:
|
||||
if (auto coroPtr = coro.lock())
|
||||
{
|
||||
if (auto optionalCountedJob =
|
||||
jobCounter_.wrap([=]() { coroPtr->resume(); }))
|
||||
jobCounter_.wrap([=]() { coroPtr->resume(); }))
|
||||
{
|
||||
addRefCountedJob(coroPtr->type_, coroPtr->name_, std::move(*optionalCountedJob));
|
||||
addRefCountedJob(
|
||||
coroPtr->type_,
|
||||
coroPtr->name_,
|
||||
std::move(*optionalCountedJob));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,8 +327,9 @@ JobQueue::stop()
|
||||
// `Job::doJob` and the return of `JobQueue::processTask`. That is why
|
||||
// we must wait on the condition variable to make these assertions.
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
cv_.wait(
|
||||
lock, [this] { return m_processCount == 0 && nSuspend_ == 0 && m_jobSet.empty(); });
|
||||
cv_.wait(lock, [this] {
|
||||
return m_processCount == 0 && nSuspend_ == 0 && m_jobSet.empty();
|
||||
});
|
||||
XRPL_ASSERT(
|
||||
m_processCount == 0,
|
||||
"ripple::JobQueue::stop : all processes completed");
|
||||
|
||||
Reference in New Issue
Block a user