Cancel a task by name.
150{
152 if (!guard.accepted)
153 return false;
154
155 bool queued = false;
156
159 bool expected = false;
160 if (op.active.compare_exchange_strong(expected, true,
161 std::memory_order_acquire, std::memory_order_relaxed)) {
162 op.entry = {
nullptr,
name };
163 op.is_addition = false;
165 queued = true;
166 break;
167 }
168 }
169 }
170
172 bool expected = false;
173 if (op.active.compare_exchange_strong(expected, true,
174 std::memory_order_acquire, std::memory_order_relaxed)) {
175 op.entry = {
nullptr,
name };
176 op.is_addition = false;
178 queued = true;
179 break;
180 }
181 }
182
183 if (!queued) {
185 "Pending task queue full, could not cancel task '{}'",
name);
186 }
187
188 return queued;
189}
#define MF_ERROR(comp, ctx,...)
std::atomic< uint32_t > m_pending_count
std::atomic< bool > m_terminating
std::atomic< uint32_t > m_conditional_pending_count
std::jthread m_conditional_thread
PendingTaskOp m_pending_ops[MAX_PENDING_TASKS]
std::atomic< uint32_t > m_inflight_submissions
PendingTaskOp m_conditional_pending_ops[MAX_PENDING_CONDITIONAL]
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
@ Vruta
Coroutines, schedulers, clocks, task management.