mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-07-19 01:15:14 -05:00
Add additional sync-helpers to reduce dependencies to switcher-data
This commit is contained in:
parent
84dd5e6930
commit
dd78b03a28
|
|
@ -14,6 +14,11 @@ std::mutex *GetSwitcherMutex()
|
|||
return switcher ? &switcher->m : nullptr;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock()
|
||||
{
|
||||
return switcher ? switcher->mainLoopLock : nullptr;
|
||||
}
|
||||
|
||||
bool VerboseLoggingEnabled()
|
||||
{
|
||||
return switcher ? switcher->verbose : false;
|
||||
|
|
|
|||
|
|
@ -3,9 +3,21 @@
|
|||
namespace advss {
|
||||
|
||||
std::mutex *GetSwitcherMutex();
|
||||
std::unique_lock<std::mutex> *GetSwitcherLoopLock();
|
||||
|
||||
std::mutex *GetMutex()
|
||||
{
|
||||
return GetSwitcherMutex();
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> LockContext()
|
||||
{
|
||||
return std::lock_guard<std::mutex>(*GetSwitcherMutex());
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> *GetLoopLock()
|
||||
{
|
||||
return GetSwitcherLoopLock();
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
namespace advss {
|
||||
|
||||
[[nodiscard]] std::mutex *GetMutex();
|
||||
[[nodiscard]] std::lock_guard<std::mutex> LockContext();
|
||||
[[nodiscard]] std::unique_lock<std::mutex> *GetLoopLock();
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user