2
0
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:
Christopher Kohlhoff
2006-11-17 11:40:48 +00:00
parent 8b56b8cf6d
commit b0e159fc55

View File

@@ -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)
{