mirror of
https://github.com/boostorg/asio.git
synced 2026-01-27 18:42:07 +00:00
Add a workaround for an apparent Windows bug where the delivery of
asynchronous I/O completions is delayed if the thread used to start the operation is CPU bound. [SVN r36069]
This commit is contained in:
@@ -260,11 +260,15 @@ private:
|
||||
LPOVERLAPPED overlapped = 0;
|
||||
::SetLastError(0);
|
||||
BOOL ok = ::GetQueuedCompletionStatus(iocp_.handle, &bytes_transferred,
|
||||
&completion_key, &overlapped, block ? INFINITE : 0);
|
||||
&completion_key, &overlapped, block ? 1000 : 0);
|
||||
DWORD last_error = ::GetLastError();
|
||||
|
||||
if (!ok && overlapped == 0)
|
||||
{
|
||||
if (block && last_error == WAIT_TIMEOUT)
|
||||
continue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (overlapped)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user