测试内存池
This commit is contained in:
@@ -18,6 +18,7 @@ typedef struct task {
|
||||
int fd;
|
||||
off_t off;
|
||||
|
||||
int refcount;
|
||||
int res; // cqe->res
|
||||
int done; // 0/1
|
||||
|
||||
@@ -39,8 +40,15 @@ typedef struct {
|
||||
task_t *q_head, *q_tail;
|
||||
|
||||
int stop;
|
||||
atomic_int in_flight;
|
||||
int max_in_flight;
|
||||
} iouring_ctx_t;
|
||||
|
||||
typedef struct {
|
||||
task_t *head;
|
||||
pthread_mutex_t lock;
|
||||
} destroy_queue_t;
|
||||
|
||||
int iouring_register_fd(iouring_ctx_t *ctx, int fd);
|
||||
|
||||
void task_init(task_t *t);
|
||||
@@ -54,6 +62,8 @@ void iouring_shutdown(iouring_ctx_t *ctx);
|
||||
|
||||
task_t* submit_write(iouring_ctx_t *ctx, int fd, void **bufs, size_t *lens, int count, off_t off);
|
||||
|
||||
void cleanup_finished_iouring_tasks();
|
||||
|
||||
extern iouring_ctx_t global_uring_ctx;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user