io/uring/Queue: DispatchCompletions() returns bool

This commit is contained in:
Max Kellermann 2025-01-20 18:38:34 +01:00 committed by Max Kellermann
parent ed819a05e3
commit 6fb91e661c

@ -64,12 +64,28 @@ public:
ring.Submit(); ring.Submit();
} }
/**
* @return true if a completion was dispatched, false if the
* completion queue was empty
*/
bool DispatchOneCompletion(); bool DispatchOneCompletion();
void DispatchCompletions() { /**
while (DispatchOneCompletion()) {} * @return true if at least one completion was dispatched,
* false if the completion queue was empty
*/
bool DispatchCompletions() {
bool result = false;
while (DispatchOneCompletion()) {
result = true;
}
return result;
} }
/**
* @return true if a completion was dispatched, false if the
* completion queue was empty
*/
bool WaitDispatchOneCompletion(); bool WaitDispatchOneCompletion();
void WaitDispatchCompletions() { void WaitDispatchCompletions() {