Add GUARD_LOADING_AND_LOCK

Helper macro to reduce repetition
This commit is contained in:
WarmUpTill 2024-06-02 00:00:37 +02:00 committed by WarmUpTill
parent 286f781f4d
commit 235b31fccc

View File

@ -5,6 +5,13 @@
namespace advss {
// Helper used in macro segment edit widgets
#define GUARD_LOADING_AND_LOCK() \
if (_loading || !_entryData) { \
return; \
} \
auto lock = LockContext();
[[nodiscard]] EXPORT std::mutex *GetMutex();
[[nodiscard]] EXPORT std::lock_guard<std::mutex> LockContext();
[[nodiscard]] EXPORT std::unique_lock<std::mutex> *GetLoopLock();