mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Adapt to enable testing and add more tests
This commit is contained in:
@@ -2,8 +2,22 @@
|
||||
|
||||
namespace advss {
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
std::mutex *GetSwitcherMutex()
|
||||
{
|
||||
static std::mutex m;
|
||||
return &m;
|
||||
}
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock()
|
||||
{
|
||||
static std::mutex m;
|
||||
static std::unique_lock<std::mutex> lock(m);
|
||||
return &lock;
|
||||
}
|
||||
#else
|
||||
std::mutex *GetSwitcherMutex();
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock();
|
||||
#endif
|
||||
|
||||
std::mutex *GetMutex()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user