From 89f3bedb3caf2297f176193fab9cd1f989f01d59 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Mon, 27 May 2019 07:05:26 +0000 Subject: * file_io/win32/readwrite.c (read_with_timeout): We do not handle WAIT_ABANDONED here because they can be returned only when waiting for mutex [1], but not for events. [1] https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-waitforsingleobject#return-value git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860107 13f79535-47bb-0310-9956-ffa450edef68 --- file_io/win32/readwrite.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'file_io') diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c index 9c06ded63..7e25b490d 100644 --- a/file_io/win32/readwrite.c +++ b/file_io/win32/readwrite.c @@ -81,15 +81,13 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le rv = apr_get_os_error(); if (rv == APR_FROM_OS_ERROR(ERROR_IO_PENDING)) { /* Wait for the pending i/o, timeout converted from us to ms - * Note that we loop if someone gives up the event, since - * folks suggest that WAIT_ABANDONED isn't actually a result - * but an alert that ownership of the event has passed from - * one owner to a new proc/thread. + * Note that we loop if someone gives up the event. + * + * NOTE: We do not handle WAIT_ABANDONED here because they + * can be returned only when waiting for mutex. */ - do { - res = apr_wait_for_single_object(file->pOverlapped->hEvent, - file->timeout); - } while (res == WAIT_ABANDONED); + res = apr_wait_for_single_object(file->pOverlapped->hEvent, + file->timeout); /* There is one case that represents entirely * successful operations, otherwise we will cancel -- cgit v1.2.1