io/uring/Queue: DispatchCompletions() returns bool
This commit is contained in:
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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user