io/uring/Queue: add method RequireSubmitEntry()

Fixes assertion failure when the submit queue is empty.
This commit is contained in:
Max Kellermann
2021-12-02 16:33:59 +01:00
committed by Max Kellermann
parent c8f174ac92
commit 799032505e
3 changed files with 30 additions and 4 deletions

View File

@@ -63,6 +63,14 @@ public:
return ring.GetSubmitEntry();
}
/**
* Like GetSubmitEntry(), but call Submit() if the submit
* queue is full.
*
* May throw exceptions if Submit() fails.
*/
struct io_uring_sqe &RequireSubmitEntry();
bool HasPending() const noexcept {
return !operations.empty();
}