mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-03 10:07:59 +02:00
Tentative workaround for the random hangs on windows.
The problem seems to be a race condition with winsock's internal threads for the non-blocking mode of the sockets, but I haven't had time to try a standalone test case yet to confirm it. Anyway, I found a workaround that fixes it in all cases, so it's good enough for now.
This commit is contained in:
parent
2e134dd74c
commit
6611816694
1 changed files with 4 additions and 5 deletions
|
|
@ -1129,12 +1129,11 @@ _dbus_poll (DBusPollFD *fds,
|
|||
max_fd = MAX (max_fd, fdp->fd);
|
||||
}
|
||||
|
||||
// Avoid random lockups with send(), for lack of a better solution so far
|
||||
tv.tv_sec = timeout_milliseconds < 0 ? 1 : timeout_milliseconds / 1000;
|
||||
tv.tv_usec = timeout_milliseconds < 0 ? 0 : (timeout_milliseconds % 1000) * 1000;
|
||||
|
||||
tv.tv_sec = timeout_milliseconds / 1000;
|
||||
tv.tv_usec = (timeout_milliseconds % 1000) * 1000;
|
||||
|
||||
ready = select (max_fd + 1, &read_set, &write_set, &err_set,
|
||||
timeout_milliseconds < 0 ? NULL : &tv);
|
||||
ready = select (max_fd + 1, &read_set, &write_set, &err_set, &tv);
|
||||
|
||||
if (DBUS_SOCKET_API_RETURNS_ERROR (ready))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue