mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
Address PR comments
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -71,13 +71,13 @@ inline JobQueue::Coro::~Coro()
|
||||
"ripple::JobQueue::Coro::~Coro : is finished");
|
||||
}
|
||||
|
||||
inline void
|
||||
inline bool
|
||||
JobQueue::Coro::yield()
|
||||
{
|
||||
{
|
||||
std::lock_guard lock(jq_.m_mutex);
|
||||
if (shouldStop())
|
||||
return;
|
||||
return false;
|
||||
|
||||
state_ = CoroState::Suspended;
|
||||
cv_.notify_all();
|
||||
|
||||
@@ -99,9 +99,11 @@ public:
|
||||
Note:
|
||||
The associated Job function returns.
|
||||
Undefined behavior if called consecutively without a corresponding
|
||||
post.
|
||||
post.
|
||||
It may not suspend at all if the JobQueue is stopping, and returns
|
||||
false in such a case.
|
||||
*/
|
||||
void
|
||||
bool
|
||||
yield();
|
||||
|
||||
/** Schedule coroutine execution.
|
||||
@@ -147,7 +149,7 @@ public:
|
||||
join();
|
||||
|
||||
/** Returns true if the coroutine should stop executing */
|
||||
bool
|
||||
[[nodiscard]] bool
|
||||
shouldStop() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user