[mythtv-commits] Ticket #6323: ThreadedFileWriter::Write() writes wrong data if buffer usage < bytes to write
MythTV
mythtv at cvs.mythtv.org
Fri Mar 6 13:56:49 UTC 2009
#6323: ThreadedFileWriter::Write() writes wrong data if buffer usage < bytes to
write
------------------------------+---------------------------------------------
Reporter: anonymous | Owner: ijr
Type: defect | Status: new
Priority: major | Milestone: unknown
Component: MythTV - General | Version: unknown
Severity: high | Mlocked: 0
------------------------------+---------------------------------------------
If ThreadedFileWrite::Write() gets called with data larger than the
currently free space available in the ring buffer, TFW::Write() loops and
writes out the data piece by piece as space gets available. Unfortunately
it never bothers increasing the offset for the data buffer it reads from,
so it basically writes out the same data every iteration, just different
sizes of it.
The following patch fixes that and adds the volatile type modifier to the
read and write position variables as they are read from and written to
from different threads. This actually tells the compiler about it (which
is a good thing) and prevents certain problems from ever happening like we
read an old value becomes it still in a register.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/6323>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list