Use the right queue for each response type
This commit is contained in:
parent
c04e7bcd47
commit
6e10e6f012
@ -288,19 +288,23 @@ class TdReceiver {
|
|||||||
std::atomic<bool> receive_lock_{false};
|
std::atomic<bool> receive_lock_{false};
|
||||||
|
|
||||||
MultiClient::Response receive_unlocked(double timeout, bool include_responses, bool include_updates) {
|
MultiClient::Response receive_unlocked(double timeout, bool include_responses, bool include_updates) {
|
||||||
if (output_responses_queue_ready_cnt_ == 0) {
|
if (include_responses) {
|
||||||
output_responses_queue_ready_cnt_ = output_responses_queue_->reader_wait_nonblock();
|
if (output_responses_queue_ready_cnt_ == 0) {
|
||||||
|
output_responses_queue_ready_cnt_ = output_responses_queue_->reader_wait_nonblock();
|
||||||
|
}
|
||||||
|
if (output_responses_queue_ready_cnt_ > 0) {
|
||||||
|
output_responses_queue_ready_cnt_--;
|
||||||
|
return output_responses_queue_->reader_get_unsafe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (output_responses_queue_ready_cnt_ > 0) {
|
if (include_updates) {
|
||||||
output_responses_queue_ready_cnt_--;
|
if (output_updates_queue_ready_cnt_ == 0) {
|
||||||
return output_responses_queue_->reader_get_unsafe();
|
output_updates_queue_ready_cnt_ = output_updates_queue_->reader_wait_nonblock();
|
||||||
}
|
}
|
||||||
if (output_updates_queue_ready_cnt_ == 0) {
|
if (output_updates_queue_ready_cnt_ > 0) {
|
||||||
output_updates_queue_ready_cnt_ = output_updates_queue_->reader_wait_nonblock();
|
output_updates_queue_ready_cnt_--;
|
||||||
}
|
return output_updates_queue_->reader_get_unsafe();
|
||||||
if (output_updates_queue_ready_cnt_ > 0) {
|
}
|
||||||
output_updates_queue_ready_cnt_--;
|
|
||||||
return output_updates_queue_->reader_get_unsafe();
|
|
||||||
}
|
}
|
||||||
if (timeout != 0) {
|
if (timeout != 0) {
|
||||||
if (include_responses && !include_updates) {
|
if (include_responses && !include_updates) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user