mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-17 09:35:51 +00:00
@@ -121,7 +121,7 @@ class JobQueue_test : public beast::unit_test::suite
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (yieldCount == 0)
|
while (yieldCount == 0)
|
||||||
; // We should wait for the job to start and yield
|
; // We should wait for the job to start and yield
|
||||||
|
|
||||||
// Wait for the Job to run and yield.
|
// Wait for the Job to run and yield.
|
||||||
coro->join();
|
coro->join();
|
||||||
|
|||||||
@@ -96,7 +96,9 @@ JobQueue::Coro::yield()
|
|||||||
inline bool
|
inline bool
|
||||||
JobQueue::Coro::post()
|
JobQueue::Coro::post()
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(state_ == CoroState::Suspended, "JobQueue::Coro::post: coroutine should be suspended!");
|
XRPL_ASSERT(
|
||||||
|
state_ == CoroState::Suspended,
|
||||||
|
"JobQueue::Coro::post: coroutine should be suspended!");
|
||||||
|
|
||||||
// sp keeps 'this' alive
|
// sp keeps 'this' alive
|
||||||
if (jq_.addJob(
|
if (jq_.addJob(
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum class CoroState { None, Suspended, Running, Finished };
|
enum class CoroState { None, Suspended, Running, Finished };
|
||||||
private:
|
|
||||||
|
|
||||||
|
private:
|
||||||
std::atomic_bool exiting_ = false;
|
std::atomic_bool exiting_ = false;
|
||||||
detail::LocalValues lvs_;
|
detail::LocalValues lvs_;
|
||||||
JobQueue& jq_;
|
JobQueue& jq_;
|
||||||
@@ -131,7 +131,10 @@ public:
|
|||||||
resume();
|
resume();
|
||||||
|
|
||||||
CoroState
|
CoroState
|
||||||
state() const { return state_; }
|
state() const
|
||||||
|
{
|
||||||
|
return state_;
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns true if the Coro is still runnable (has not returned). */
|
/** Returns true if the Coro is still runnable (has not returned). */
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user