Remove spurious assert

fix #1099
This commit is contained in:
Vinnie Falco
2018-05-18 16:45:58 -07:00
parent 86555b90ae
commit 6ea66fd89e
3 changed files with 9 additions and 18 deletions

View File

@ -1,6 +1,7 @@
Version 171: Version 171:
* Add handler_ptr::has_value * Add handler_ptr::has_value
* Remove spurious assert
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -138,14 +138,8 @@ operator()(
d.cont = cont; d.cont = cont;
BOOST_ASIO_CORO_REENTER(*this) BOOST_ASIO_CORO_REENTER(*this)
{ {
// Maybe suspend // Attempt to acquire write block
if(d.ws.wr_block_.try_lock(this)) if(! d.ws.wr_block_.try_lock(this))
{
// Make sure the stream is open
if(! d.ws.check_open(ec))
goto upcall;
}
else
{ {
// Suspend // Suspend
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
@ -159,12 +153,12 @@ operator()(
boost::asio::post( boost::asio::post(
d.ws.get_executor(), std::move(*this)); d.ws.get_executor(), std::move(*this));
BOOST_ASSERT(d.ws.wr_block_.is_locked(this)); BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
// Make sure the stream is open
if(! d.ws.check_open(ec))
goto upcall;
} }
// Make sure the stream is open
if(! d.ws.check_open(ec))
goto upcall;
// Can't call close twice // Can't call close twice
BOOST_ASSERT(! d.ws.wr_close_); BOOST_ASSERT(! d.ws.wr_close_);

View File

@ -626,12 +626,8 @@ operator()(
goto upcall; goto upcall;
close: close:
if(ws_.wr_block_.try_lock(this)) // Try to acquire the write block
{ if(! ws_.wr_block_.try_lock(this))
// Make sure the stream is open
BOOST_ASSERT(ws_.status_ == status::open);
}
else
{ {
// Suspend // Suspend
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD