Fix formatting

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2025-10-02 11:48:56 +01:00
parent bce1520d4b
commit fbe4f7dd9f
2 changed files with 15 additions and 12 deletions

View File

@@ -57,12 +57,7 @@ struct Coro_create_t
class JobQueue : private Workers::Callback
{
public:
enum class QueueState
{
Accepting,
Stopping,
Stopped
};
enum class QueueState { Accepting, Stopping, Stopped };
/** Coroutines must run to completion. */
class Coro : public std::enable_shared_from_this<Coro>
@@ -178,13 +173,14 @@ public:
template <typename JobHandler>
bool
addJob(JobType type, std::string const& name, JobHandler&& jobHandler)
requires std::is_void_v<std::invoke_result_t<JobHandler>>
requires std::is_void_v<std::invoke_result_t<JobHandler>>
{
if (queueState_ != QueueState::Accepting)
{
return false;
}
return addJobNoStatusCheck(type, name, std::forward<JobHandler>(jobHandler));
return addJobNoStatusCheck(
type, name, std::forward<JobHandler>(jobHandler));
}
/** Creates a coroutine and adds a job to the queue which will run it.
@@ -293,8 +289,11 @@ private:
template <typename JobHandler>
bool
addJobNoStatusCheck(JobType type, std::string const& name, JobHandler&& jobHandler)
requires std::is_void_v<std::invoke_result_t<JobHandler>>
addJobNoStatusCheck(
JobType type,
std::string const& name,
JobHandler&& jobHandler)
requires std::is_void_v<std::invoke_result_t<JobHandler>>
{
if (auto optionalCountedJob =
jobCounter_.wrap(std::forward<JobHandler>(jobHandler)))

View File

@@ -310,7 +310,8 @@ JobQueue::stop()
if (!queueState_.compare_exchange_strong(accepting, QueueState::Stopping))
{
XRPL_ASSERT(false, "Incorrect queueState, should be accepting but not!");
XRPL_ASSERT(
false, "Incorrect queueState, should be accepting but not!");
}
std::map<void*, std::weak_ptr<Coro>> suspendedCoros;
{
@@ -327,7 +328,10 @@ JobQueue::stop()
{
// We don't allow any new jobs from outside when we are
// stopping, but we should allow new jobs from inside the class.
addJobNoStatusCheck(coroPtr->type_, coroPtr->name_, [coroPtr]() { coroPtr->resume(); });
addJobNoStatusCheck(
coroPtr->type_, coroPtr->name_, [coroPtr]() {
coroPtr->resume();
});
}
}
}