mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
Use g_cancellable_release_fd()
Part of: Bug 591388 - number of GCancellables available is too limited
This commit is contained in:
parent
e2c97292c2
commit
faae032ad0
@ -2255,7 +2255,10 @@ winsock_finalize (GSource *source)
|
||||
g_object_unref (socket);
|
||||
|
||||
if (winsock_source->cancellable)
|
||||
g_object_unref (winsock_source->cancellable);
|
||||
{
|
||||
g_cancellable_release_fd (winsock_source->cancellable);
|
||||
g_object_unref (winsock_source->cancellable);
|
||||
}
|
||||
}
|
||||
|
||||
static GSourceFuncs winsock_funcs =
|
||||
@ -2470,6 +2473,8 @@ g_socket_condition_wait (GSocket *socket,
|
||||
current_condition = update_condition (socket);
|
||||
}
|
||||
remove_condition_watch (socket, &condition);
|
||||
if (num_events > 1)
|
||||
g_cancellable_release_fd (cancellable);
|
||||
|
||||
return (condition & current_condition) != 0;
|
||||
}
|
||||
@ -2489,6 +2494,9 @@ g_socket_condition_wait (GSocket *socket,
|
||||
do
|
||||
result = g_poll (poll_fd, num, -1);
|
||||
while (result == -1 && get_socket_errno () == EINTR);
|
||||
|
||||
if (num > 1)
|
||||
g_cancellable_release_fd (cancellable);
|
||||
|
||||
return cancellable == NULL ||
|
||||
!g_cancellable_set_error_if_cancelled (cancellable, error);
|
||||
|
@ -347,7 +347,8 @@ g_unix_input_stream_read (GInputStream *stream,
|
||||
do
|
||||
poll_ret = g_poll (poll_fds, 2, -1);
|
||||
while (poll_ret == -1 && errno == EINTR);
|
||||
|
||||
g_cancellable_release_fd (cancellable);
|
||||
|
||||
if (poll_ret == -1)
|
||||
{
|
||||
int errsv = errno;
|
||||
|
@ -333,6 +333,7 @@ g_unix_output_stream_write (GOutputStream *stream,
|
||||
do
|
||||
poll_ret = g_poll (poll_fds, 2, -1);
|
||||
while (poll_ret == -1 && errno == EINTR);
|
||||
g_cancellable_release_fd (cancellable);
|
||||
|
||||
if (poll_ret == -1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user