20#include <test/jtx/Env.h>
22#include <xrpld/core/JobQueue.h>
24#include <xrpl/beast/unit_test.h>
38 JobQueue& jQueue = env.app().getJobQueue();
47 while (jobRan ==
false)
54 using namespace std::chrono_literals;
73 JobQueue& jQueue = env.app().getJobQueue();
81 while (++yieldCount < 4)
84 BEAST_EXPECT(coro !=
nullptr);
87 while (yieldCount == 0)
92 while (coro->runnable())
94 BEAST_EXPECT(coro->post());
95 while (old == yieldCount)
99 BEAST_EXPECT(++old == yieldCount);
101 BEAST_EXPECT(yieldCount == 4);
110 while (++yieldCount < 4)
125 int old = yieldCount;
126 while (coro->runnable())
129 BEAST_EXPECT(++old == yieldCount);
131 BEAST_EXPECT(yieldCount == 4);
137 using namespace std::chrono_literals;
150 BEAST_EXPECT(coro ==
nullptr);
A pool of threads to perform work.
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
void run() override
Runs the suite.
A transaction testing environment.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.