Fix event loop io tree inconsistency on Windows.
On Windows, the event loop io tree uses the Windows Event handle to
differentiate between io_t objects. Unfortunately, there is a bug in
the io_add_event() function (introduced in
2f9a1d4ab5
) as it sets the event after
inserting the object into the tree, resulting in objects appearing in
io_tree out of order.
This can lead to crashes on Windows as the event loop is unable to
determine which events fired.
This commit is contained in:
parent
fcf5b53e78
commit
163773d710
1 changed files with 1 additions and 1 deletions
|
@ -91,8 +91,8 @@ void io_add(io_t *io, io_cb_t cb, void *data, int fd, int flags) {
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
void io_add_event(io_t *io, io_cb_t cb, void *data, WSAEVENT event) {
|
void io_add_event(io_t *io, io_cb_t cb, void *data, WSAEVENT event) {
|
||||||
io_add(io, cb, data, -1, 0);
|
|
||||||
io->event = event;
|
io->event = event;
|
||||||
|
io_add(io, cb, data, -1, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue