finish_consuming_dead_subbuffer: fix data_size read race, reread new consumed count
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 3 Mar 2011 17:53:52 +0000 (12:53 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 3 Mar 2011 17:53:52 +0000 (12:53 -0500)
commitc74e3560aa89ea4dac242ceae06355f5a1ddc2c9
treea21f70e857b9ff5c88ad3b5e71ddf8e74abeadd0
parentf3d96ee020d41cbc252adb71d80fe548fb8b103c
finish_consuming_dead_subbuffer: fix data_size read race, reread new consumed count

Make sure finish_consuming_dead_subbuffer always see a data_size that is non
0xffffffff only when the buffer data is entirely readable, else the code rely on
the commit_seq counter which is the proper solution.

The consumed count should be re-read in each test within the loop, otherwise the
mathematic formula to get the amount of data to read does not work wrt
buffer-size wrap-around.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libust/buffers.c
libustconsumer/lowlevel.c
This page took 0.023565 seconds and 4 git commands to generate.