13
0

audiosource: lock held during peak reading must be a write lock

We modify elements of the source object, not to mention the peakfiles on disk. This
was a regression introduced when switching from Lock to RWLock, caused by a failure
to recognize this as a case where a write lock was required.

The presence of scoped_array<> as a member of AudioSource (peak_cache) is suspicious
nevertheless, and we should establish that it serves a useful purpose.
This commit is contained in:
Paul Davis 2022-04-25 19:03:06 -06:00
parent b8ebdbc44a
commit f06d04c174

View File

@ -762,7 +762,7 @@ AudioSource::build_peaks_from_scratch ()
{
/* hold lock while building peaks */
ReaderLock lp (_lock);
WriterLock lp (_lock);
if (prepare_for_peakfile_writes ()) {
goto out;