1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-11 07:06:33 +01:00

Redefine ODLocker as movable, and it may try-lock only.

This commit is contained in:
Paul Licameli
2016-04-17 09:54:14 -04:00
parent 185d5e132d
commit 94cf94718e
4 changed files with 36 additions and 18 deletions

View File

@@ -118,13 +118,11 @@ OSType sf_header_mactype(int format);
// This function wrapper uses a mutex to serialize calls to the SndFile library.
#include "MemoryX.h"
#include "ondemand/ODTaskThread.h"
class ODLock;
class ODLocker;
extern ODLock libSndFileMutex;
template<typename R, typename F, typename... Args>
inline R SFCall(F fun, Args&&... args)
{
ODLocker locker{ libSndFileMutex };
ODLocker locker{ &libSndFileMutex };
return fun(std::forward<Args>(args)...);
}