mirror of
https://github.com/boostorg/asio.git
synced 2026-02-26 02:42:08 +00:00
Don't perform a speculative read when an out-of-band read is pending.
[SVN r60939]
This commit is contained in:
@@ -126,18 +126,20 @@ public:
|
||||
|
||||
if (allow_speculative)
|
||||
{
|
||||
if (!op_queue_[op_type].has_operation(descriptor))
|
||||
if (op_type != read_op || !op_queue_[except_op].has_operation(descriptor))
|
||||
{
|
||||
if (op->perform())
|
||||
if (!op_queue_[op_type].has_operation(descriptor))
|
||||
{
|
||||
lock.unlock();
|
||||
io_service_.post_immediate_completion(op);
|
||||
return;
|
||||
if (op->perform())
|
||||
{
|
||||
lock.unlock();
|
||||
io_service_.post_immediate_completion(op);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool first = op_queue_[op_type].enqueue_operation(descriptor, op);
|
||||
io_service_.work_started();
|
||||
if (first)
|
||||
|
||||
@@ -180,7 +180,9 @@ public:
|
||||
|
||||
if (descriptor_data->op_queue_[op_type].empty())
|
||||
{
|
||||
if (allow_speculative)
|
||||
if (allow_speculative
|
||||
&& (op_type != read_op
|
||||
|| descriptor_data->op_queue_[except_op].empty()))
|
||||
{
|
||||
if (op->perform())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user