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)
|
if (res->callback == NULL)
|
||||||
break;
|
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 {
|
enum io_restype {
|
||||||
IO_RES_VOID,
|
IO_RES_VOID,
|
||||||
IO_RES_FILE,
|
IO_RES_FILE,
|
||||||
IO_RES_SOCKET,
|
IO_RES_SOCKET,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*io_callback)(struct io_event);
|
|
||||||
|
|
||||||
struct io_resource {
|
struct io_resource {
|
||||||
enum io_restype type;
|
enum io_restype type;
|
||||||
io_os_handle os_handle;
|
io_os_handle os_handle;
|
||||||
|
|||||||
Reference in New Issue
Block a user