[+] Added AU_TRY_LOCK_GUARD_NAMED
This commit is contained in:
parent
9c8224b931
commit
c51404e074
@ -86,8 +86,10 @@ namespace Aurora::Threading
|
||||
};
|
||||
|
||||
#define AU_TRY_LOCK_GUARD(variable) Aurora::Threading::TryLockGuard<decltype(variable)> AU_CONCAT(__stack_lock, __COUNTER__) (variable);
|
||||
#define AU_TRY_LOCK_GUARD_RET_(variable, value, counter) Aurora::Threading::TryLockGuard<decltype(variable)> AU_CONCAT(__stack_lock, counter) (variable); if (!(AU_CONCAT(__stack_lock, counter).Locked())) return value;
|
||||
#define AU_TRY_LOCK_GUARD_RET_VAL(variable, value) AU_TRY_LOCK_GUARD_RET_(variable, value, AU_WHAT(__COUNTER__))
|
||||
#define AU_TRY_LOCK_GUARD_RET_NAMED(variable, value, name) Aurora::Threading::TryLockGuard<decltype(variable)> name (variable); if (!(name.Locked())) return value;
|
||||
#define AU_TRY_LOCK_GUARD_RET(variable, value, counter) AU_TRY_LOCK_GUARD_RET_NAMED(variable, value, AU_CONCAT(__stack_lock, counter))
|
||||
#define AU_TRY_LOCK_GUARD_RET_VAL(variable, value) AU_TRY_LOCK_GUARD_RET_NAMED(variable, value, AU_WHAT(__COUNTER__))
|
||||
#define AU_TRY_LOCK_GUARD_RET_DEF(variable) AU_TRY_LOCK_GUARD_RET_VAL(variable, {})
|
||||
#define AU_TRY_LOCK_GUARD_RET(variable) AU_TRY_LOCK_GUARD_RET_VAL(variable, )
|
||||
}
|
||||
#define AU_TRY_LOCK_GUARD_NAMED(variable, name) AU_TRY_LOCK_GUARD_RET_NAMED(variable, , name)
|
||||
}2
|
Loading…
Reference in New Issue
Block a user