2
0
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:
Christopher Kohlhoff
2010-03-30 12:30:00 +00:00
parent d02eb70ec9
commit 1ea2d5330f
2 changed files with 11 additions and 7 deletions

View File

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

View File

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