fixed race condition

This commit is contained in:
orignal 2015-04-05 13:56:41 -04:00
parent 10577cd1e5
commit 250af7f247
2 changed files with 3 additions and 3 deletions

View file

@ -235,8 +235,8 @@ namespace stream
s->HandleReceiveTimer (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), buffer, handler);
else
{
m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout));
m_ReceiveTimer.async_wait ([=](const boost::system::error_code& ecode)
s->m_ReceiveTimer.expires_from_now (boost::posix_time::seconds(timeout));
s->m_ReceiveTimer.async_wait ([=](const boost::system::error_code& ecode)
{ s->HandleReceiveTimer (ecode, buffer, handler); });
}
});