Add io_context argument to the callback
This commit is contained in:
@@ -1017,7 +1017,7 @@ void io_wait(struct io_context *ioc,
|
||||
if (res->callback == NULL)
|
||||
break;
|
||||
|
||||
res->callback(*ev);
|
||||
res->callback(ioc, *ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,14 +81,16 @@ struct io_event {
|
||||
};
|
||||
};
|
||||
|
||||
struct io_context;
|
||||
|
||||
typedef void (*io_callback)(struct io_context *ioc, struct io_event);
|
||||
|
||||
enum io_restype {
|
||||
IO_RES_VOID,
|
||||
IO_RES_FILE,
|
||||
IO_RES_SOCKET,
|
||||
};
|
||||
|
||||
typedef void (*io_callback)(struct io_event);
|
||||
|
||||
struct io_resource {
|
||||
enum io_restype type;
|
||||
io_os_handle os_handle;
|
||||
|
||||
Reference in New Issue
Block a user