io/uring/Queue: make Submit() virtual, Push() not
This allows submitting io_uring calls without an `Operation` instance (fire & forget). We'll do that for close().
This commit is contained in:
parent
6496c1b806
commit
26577d1301
@ -20,7 +20,7 @@ void
|
||||
Manager::OnIdle() noexcept
|
||||
{
|
||||
try {
|
||||
Submit();
|
||||
Queue::Submit();
|
||||
} catch (...) {
|
||||
PrintException(std::current_exception());
|
||||
}
|
||||
|
@ -23,9 +23,7 @@ public:
|
||||
event.ScheduleRead();
|
||||
}
|
||||
|
||||
void Push(struct io_uring_sqe &sqe,
|
||||
Operation &operation) noexcept override {
|
||||
AddPending(sqe, operation);
|
||||
void Submit() override {
|
||||
idle_event.Schedule();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ Queue::RequireSubmitEntry()
|
||||
if (sqe == nullptr) {
|
||||
/* the submit queue is full; submit it to the kernel
|
||||
and try again */
|
||||
Submit();
|
||||
ring.Submit();
|
||||
|
||||
sqe = GetSubmitEntry();
|
||||
if (sqe == nullptr)
|
||||
|
@ -52,13 +52,13 @@ protected:
|
||||
Operation &operation) noexcept;
|
||||
|
||||
public:
|
||||
virtual void Push(struct io_uring_sqe &sqe,
|
||||
Operation &operation) noexcept {
|
||||
void Push(struct io_uring_sqe &sqe,
|
||||
Operation &operation) noexcept {
|
||||
AddPending(sqe, operation);
|
||||
Submit();
|
||||
}
|
||||
|
||||
void Submit() {
|
||||
virtual void Submit() {
|
||||
ring.Submit();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user