Fix a regression on Windows where multiple threads are running an io_service.

This commit is contained in:
Christopher Kohlhoff 2013-08-05 18:49:00 +10:00
parent 6d378acf13
commit ff5ed66909

View File

@ -282,7 +282,8 @@ void win_iocp_io_service::on_pending(win_iocp_operation* op)
if (::InterlockedCompareExchange(&op->ready_, 1, 0) == 1)
{
// Enqueue the operation on the I/O completion port.
if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, op))
if (!::PostQueuedCompletionStatus(iocp_.handle,
0, overlapped_contains_result, op))
{
// Out of resources. Put on completed queue instead.
mutex::scoped_lock lock(dispatch_mutex_);