io/uring/Ring: add SubmitAndGetEvents()
This commit is contained in:
parent
2e3a51a5da
commit
ed819a05e3
@ -49,6 +49,10 @@ protected:
|
|||||||
void AddPending(struct io_uring_sqe &sqe,
|
void AddPending(struct io_uring_sqe &sqe,
|
||||||
Operation &operation) noexcept;
|
Operation &operation) noexcept;
|
||||||
|
|
||||||
|
void SubmitAndGetEvents() {
|
||||||
|
ring.SubmitAndGetEvents();
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Push(struct io_uring_sqe &sqe,
|
void Push(struct io_uring_sqe &sqe,
|
||||||
Operation &operation) noexcept {
|
Operation &operation) noexcept {
|
||||||
|
@ -22,6 +22,14 @@ Ring::Submit()
|
|||||||
throw MakeErrno(-error, "io_uring_submit() failed");
|
throw MakeErrno(-error, "io_uring_submit() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Ring::SubmitAndGetEvents()
|
||||||
|
{
|
||||||
|
int error = io_uring_submit_and_get_events(&ring);
|
||||||
|
if (error < 0)
|
||||||
|
throw MakeErrno(-error, "io_uring_submit() failed");
|
||||||
|
}
|
||||||
|
|
||||||
struct io_uring_cqe *
|
struct io_uring_cqe *
|
||||||
Ring::WaitCompletion()
|
Ring::WaitCompletion()
|
||||||
{
|
{
|
||||||
|
@ -53,9 +53,18 @@ public:
|
|||||||
* kernel using io_uring_submit().
|
* kernel using io_uring_submit().
|
||||||
*
|
*
|
||||||
* Throws on error.
|
* Throws on error.
|
||||||
|
*
|
||||||
|
* @see io_uring_submit()
|
||||||
*/
|
*/
|
||||||
void Submit();
|
void Submit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like Submit(), but also flush completions.
|
||||||
|
*
|
||||||
|
* @see io_uring_submit_and_get_events()
|
||||||
|
*/
|
||||||
|
void SubmitAndGetEvents();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits for one completion.
|
* Waits for one completion.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user