Commit 98cdd828 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ws2_32: Make wait in WSAPoll() alertable.

parent 36d7bf95
......@@ -2994,7 +2994,7 @@ int WINAPI WSAPoll( WSAPOLLFD *fds, ULONG count, int timeout )
params, params_size, params, params_size );
if (status == STATUS_PENDING)
{
if (WaitForSingleObject( sync_event, INFINITE ) == WAIT_FAILED)
if (wait_event_alertable( sync_event ) == WAIT_FAILED)
{
free( params );
return -1;
......
......@@ -8122,7 +8122,11 @@ static void test_WSAPoll(void)
fds[0].fd = client;
fds[0].events = POLLRDNORM | POLLRDBAND;
fds[0].revents = 0xdead;
apc_count = 0;
ret = QueueUserAPC(apc_func, GetCurrentThread(), (ULONG_PTR)&apc_count);
ok(ret, "QueueUserAPC returned %d\n", ret);
ret = pWSAPoll(fds, 1, 2000);
ok(apc_count == 1, "APC was called %u times\n", apc_count);
ok(ret == 1, "got %d\n", ret);
ok(fds[0].revents == POLLNVAL, "got events %#x\n", fds[0].revents);
ret = WaitForSingleObject(thread_handle, 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment