io/uring/Queue: dispatch all completions in SubmitAndWaitDispatchOneCompletion()
io_uring_submit_and_wait_timeout() can return multiple completions, even if we wait for only one. We should dispatch them all or we miss wakeups.
This commit is contained in:
parent
2276ebd70f
commit
bca9e3e347
@ -104,14 +104,13 @@ Queue::WaitDispatchOneCompletion()
|
||||
}
|
||||
|
||||
bool
|
||||
Queue::SubmitAndWaitDispatchOneCompletion(struct __kernel_timespec &timeout)
|
||||
Queue::SubmitAndWaitDispatchCompletions(struct __kernel_timespec &timeout)
|
||||
{
|
||||
auto *cqe = ring.SubmitAndWaitCompletion(timeout);
|
||||
if (cqe == nullptr)
|
||||
return false;
|
||||
|
||||
DispatchOneCompletion(*cqe);
|
||||
return true;
|
||||
return DispatchCompletions(*cqe) > 0;
|
||||
}
|
||||
|
||||
} // namespace Uring
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
while (WaitDispatchOneCompletion()) {}
|
||||
}
|
||||
|
||||
bool SubmitAndWaitDispatchOneCompletion(struct __kernel_timespec &timeout);
|
||||
bool SubmitAndWaitDispatchCompletions(struct __kernel_timespec &timeout);
|
||||
|
||||
private:
|
||||
static void _DispatchOneCompletion(const struct io_uring_cqe &cqe) noexcept;
|
||||
|
Loading…
x
Reference in New Issue
Block a user