mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Fix test case bug
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -87,6 +87,8 @@ class JobQueue_test : public beast::unit_test::suite
|
||||
while (yieldCount == 0)
|
||||
;
|
||||
|
||||
coro->join();
|
||||
|
||||
// Now re-post until the Coro says it is done.
|
||||
int old = yieldCount;
|
||||
while (coro->runnable())
|
||||
|
||||
@@ -83,11 +83,9 @@ JobQueue::Coro::yield()
|
||||
if (shouldStop())
|
||||
return;
|
||||
|
||||
{
|
||||
std::lock_guard stateLock{mutex_run_};
|
||||
state_ = CoroState::Suspended;
|
||||
cv_.notify_all();
|
||||
}
|
||||
state_ = CoroState::Suspended;
|
||||
cv_.notify_all();
|
||||
|
||||
++jq_.nSuspend_;
|
||||
jq_.m_suspendedCoros[this] = weak_from_this();
|
||||
jq_.cv_.notify_all();
|
||||
@@ -115,11 +113,11 @@ inline void
|
||||
JobQueue::Coro::resume()
|
||||
{
|
||||
{
|
||||
if (state_ != CoroState::Suspended)
|
||||
auto suspended = CoroState::Suspended;
|
||||
if (!state_.compare_exchange_strong(suspended, CoroState::Running))
|
||||
{
|
||||
return;
|
||||
}
|
||||
state_ = CoroState::Running;
|
||||
cv_.notify_all();
|
||||
}
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user