1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-11 15:16:27 +01:00

Reviewed the ODLocks removed at cbf1bb5, restored just two of them...

... as std::mutex instead.

One is the mutex for the set of all files.

Another is in Profiler.h, which is now back into CMakeLists because the header
is included in one place.  Maybe this utility will find more use again.

Restored one other but commented out, as not necessary now, but need might be
found to put it back again.

The class ODLock was a misnamed thing not specific to the on-demand manager but
used more widely as a thread synchronization utility, functioning as a mutex
object.  It was a mistake to remove all uses of it along with the rest of the
on-demand system.
This commit is contained in:
Paul Licameli
2020-07-07 16:22:31 -04:00
parent 163dd719cc
commit ba7ebbb032
7 changed files with 31 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
#include "audacity/Types.h"
//#include <mutex>
#include "MemoryX.h"
#include "sndfile.h"
@@ -105,9 +106,16 @@ extern FileExtensions sf_get_all_extensions();
wxString sf_normalize_name(const char *name);
// This function wrapper uses a mutex to serialize calls to the SndFile library.
// PRL: Keeping this in a comment, but with Unitary, the only remaining uses
// of libsndfile should be in import/export and so are on the main thread only
//extern std::mutex libSndFileMutex;
template<typename R, typename F, typename... Args>
inline R SFCall(F fun, Args&&... args)
{
//std::lock_guard<std::mutex> guard{ libSndFileMutex };
return fun(std::forward<Args>(args)...);
}