1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 11:42:17 +01:00

Access BlockFile::mFileName without copying, with proper multithreading cautions

This commit is contained in:
Paul Licameli
2016-04-17 11:42:33 -04:00
parent 94cf94718e
commit 3d102a3390
8 changed files with 65 additions and 32 deletions

View File

@@ -369,13 +369,9 @@ void ODDecodeBlockFile::SetFileName(wxFileNameWrapper &&name)
}
///sets the file name the summary info will be saved in. threadsafe.
wxFileName ODDecodeBlockFile::GetFileName() const
auto ODDecodeBlockFile::GetFileName() const -> GetFileNameResult
{
wxFileName name;
mFileNameMutex.Lock();
name = mFileName;
mFileNameMutex.Unlock();
return name;
return { mFileName, ODLocker{ &mFileNameMutex } };
}
/// A thread-safe version of CalcSummary. BlockFile::CalcSummary