Clear SQEs before returning them to the caller to prevent erroneous double submissions

This commit is contained in:
Vitaliy Filippov
2021-02-02 01:26:54 +03:00
parent 036c6d4c42
commit e66ed47515
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -142,7 +142,10 @@ public:
return NULL;
struct io_uring_sqe* sqe = io_uring_get_sqe(&ring);
if (sqe)
{
*sqe = { 0 };
io_uring_sqe_set_data(sqe, ring_datas + free_ring_data[--free_ring_data_ptr]);
}
return sqe;
}
inline int wait_sqe(std::function<void()> cb)