MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / complete

Method complete

include/exec/linux/io_uring_context.hpp:311–336  ·  view source on GitHub ↗

This function first completes all tasks that are ready in the completion queue of the io_uring. Then it completes all tasks that are ready in the given queue of ready tasks. The function returns the number of previously submitted completed tasks.

Source from the content-addressed store, hash-verified

309 // Then it completes all tasks that are ready in the given queue of ready tasks.
310 // The function returns the number of previously submitted completed tasks.
311 auto complete(STDEXEC::__intrusive_queue<&__task::__next_> __ready = __task_queue{}) noexcept
312 -> int
313 {
314 __u32 __head = __head_.load(STDEXEC::__std::memory_order_relaxed);
315 __u32 __tail = __tail_.load(STDEXEC::__std::memory_order_acquire);
316 int __count = 0;
317 while (__head != __tail)
318 {
319 __u32 const __index = __head & __mask_;
320 ::io_uring_cqe const & __cqe = __entries_[__index];
321 auto* __op = bit_cast<__task*>(__cqe.user_data);
322 __op->__vtable_->__complete_(__op, __cqe);
323 ++__head;
324 ++__count;
325 __tail = __tail_.load(STDEXEC::__std::memory_order_acquire);
326 }
327 __head_.store(__head, STDEXEC::__std::memory_order_release);
328 while (!__ready.empty())
329 {
330 __task* __op = __ready.pop_front();
331 ::io_uring_cqe __dummy_cqe{};
332 __dummy_cqe.user_data = bit_cast<__u64>(__op);
333 __op->__vtable_->__complete_(__op, __dummy_cqe);
334 }
335 return __count;
336 }
337 };
338
339 class __context;

Callers

nothing calls this directly

Calls 5

loadMethod · 0.45
__complete_Method · 0.45
storeMethod · 0.45
emptyMethod · 0.45
pop_frontMethod · 0.45

Tested by

no test coverage detected