20#include <test/jtx/Env.h>
21#include <xrpld/core/JobQueue.h>
22#include <xrpl/beast/unit_test.h>
36 JobQueue& jQueue = env.app().getJobQueue();
45 while (jobRan ==
false)
52 using namespace std::chrono_literals;
71 JobQueue& jQueue = env.app().getJobQueue();
79 while (++yieldCount < 4)
82 BEAST_EXPECT(coro !=
nullptr);
85 while (yieldCount == 0)
90 while (coro->runnable())
92 BEAST_EXPECT(coro->post());
93 while (old == yieldCount)
97 BEAST_EXPECT(++old == yieldCount);
99 BEAST_EXPECT(yieldCount == 4);
108 while (++yieldCount < 4)
123 int old = yieldCount;
124 while (coro->runnable())
127 BEAST_EXPECT(++old == yieldCount);
129 BEAST_EXPECT(yieldCount == 4);
135 using namespace std::chrono_literals;
148 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.