diff options
author | Josh Blum | 2013-05-11 19:49:01 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-11 19:49:01 -0700 |
commit | 9e0345551eb0916ad10f57bfdfd434fc2ea8b74c (patch) | |
tree | f38f0d112e5420540432b57cbb54cc15314feb09 /lib/gras_impl/output_buffer_queues.hpp | |
parent | 30123ef51202f8e7e8d9da833e42b23ef77e02f3 (diff) | |
download | sandhi-9e0345551eb0916ad10f57bfdfd434fc2ea8b74c.tar.gz sandhi-9e0345551eb0916ad10f57bfdfd434fc2ea8b74c.tar.bz2 sandhi-9e0345551eb0916ad10f57bfdfd434fc2ea8b74c.zip |
gras: make output_buffer_queues match previous logic
Diffstat (limited to 'lib/gras_impl/output_buffer_queues.hpp')
-rw-r--r-- | lib/gras_impl/output_buffer_queues.hpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/gras_impl/output_buffer_queues.hpp b/lib/gras_impl/output_buffer_queues.hpp index 2d7304a..4652fa6 100644 --- a/lib/gras_impl/output_buffer_queues.hpp +++ b/lib/gras_impl/output_buffer_queues.hpp @@ -122,14 +122,17 @@ struct OutputBufferQueues GRAS_FORCE_INLINE void _update(const size_t i) { - size_t avail = 0; + const bool was_ready = _bitset[i]; if (_queues[i] and not _queues[i]->empty()) { const SBuffer &front = _queues[i]->front(); - avail = front.get_actual_length() - front.offset - front.length; + const size_t avail = front.get_actual_length() - front.offset - front.length; + _bitset.set(i, avail >= _reserve_bytes[i]); + } + else + { + _bitset.reset(i); } - const bool was_ready = _bitset[i]; - _bitset.set(i, avail >= _reserve_bytes[i]); const bool is_ready = _bitset[i]; if (is_ready and not was_ready) total_idle_times[i] += (time_now() - _became_idle_times[i]); if (not is_ready and was_ready) _became_idle_times[i] = time_now(); |